N
N
Nikolai Antonov2016-08-19 11:19:07
JavaScript
Nikolai Antonov, 2016-08-19 11:19:07

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

1 answer(s)
M
Mikhail Osher, 2016-08-19
@my-nickname

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 question

Ask a Question

731 491 924 answers to any question