Answer the question
In order to leave comments, you need to log in
What is the best way to pass dynamic data to a react component?
I'm working on a chart component and I need the data to be displayed reactively. What is the best way to pass them to the component? props are used for immutable data. What if you need to update the chart every 3 seconds?
Answer the question
In order to leave comments, you need to log in
via props. Decompose the component if it is large so that the diagrams are as independent as possible. Also, read about reconcillation (key, index, shouldComponentUpdate).
React is smart and understands which part of the tree to update based on virtual DOM diffs.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question