Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dd59162

Browse files
stop mutating inputs (#58)
1 parent 2742d0b commit dd59162

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎src/factory.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ export default function plotComponentFactory(Plotly) {
175175
}
176176
}
177177

178-
syncWindowResize(props, invoke) {
179-
props = props || this.props;
178+
syncWindowResize(propsIn, invoke) {
179+
constprops = propsIn || this.props;
180180
if (!isBrowser) return;
181181

182182
if (props.fit && !this.fitHandler) {
@@ -211,9 +211,9 @@ export default function plotComponentFactory(Plotly) {
211211
}
212212

213213
// Attach and remove event handlers as they're added or removed from props:
214-
syncEventHandlers(props) {
214+
syncEventHandlers(propsIn) {
215215
// Allow use of nextProps if passed explicitly:
216-
props = props || this.props;
216+
constprops = propsIn || this.props;
217217

218218
for (let i = 0; i < eventNames.length; i++) {
219219
const eventName = eventNames[i];
@@ -244,9 +244,9 @@ export default function plotComponentFactory(Plotly) {
244244
return objectAssign({}, layout, this.getSize(layout));
245245
}
246246

247-
getSize(layout) {
247+
getSize(layoutIn) {
248248
let rect;
249-
layout = layout || this.props.layout;
249+
constlayout = layoutIn || this.props.layout;
250250
const layoutWidth = layout ? layout.width : null;
251251
const layoutHeight = layout ? layout.height : null;
252252
const hasWidth = isNumeric(layoutWidth);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /