plotly / plotly/react-plotly.js
Props should not be mutated by Plot component
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.1k
- Forks
- 138
- Ø Merge
- 3 T. 2 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
It seems like the Plot component mutates its props (at least layout) instead of cloning the data.
Mutation of props is to me unexpected (and undesired) behavior for a react component.
If for instance the layout is stored in the state of a component and then fed to the Plot component as a prop, like
render() {
<Plot
layout={this.state.layout},
...
/>
we will have a problem, since this.state only should be updated with the react setState() method.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Das Issue nennt die Plot-Komponente und ihre layout-Prop; beginne damit, die Verarbeitung von layout in der Komponente zu lokalisieren und das Verhalten mit einem im State gehaltenen layout zu reproduzieren. Erledigt ist die Aufgabe, wenn die Komponente das übergebene layout nicht mehr verändert, was mit einem Regressionstest verifiziert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, react
- Bereich
- data-visualization, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100