N
N
Nikolai Antonov2016-08-04 16:06:42
React
Nikolai Antonov, 2016-08-04 16:06:42

How to make a binding for dynamically created elements in react?

I'm making a calendar component, like on a github - 8AnXW5BIq6PRJm.jpg
The color will also change, depending on the activity. The data will change in real time, and since there will be a lot of it, there may be performance issues. I think it's better not to use state. The only option seems to me to be ref. But how will ref behave with dynamically created data?
Or can you suggest something else to solve my problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Osher, 2016-08-04
@miraage

In my opinion, subject to the following points, everything should work with lightning speed:
- well-formed (normalized) state
- splitting components into container / presenter
- correct use of shouldComponentUpdate, and reconciliation (key, index on collections) in general.

L
Leonid Prokopchuk, 2016-08-04
@leopro

If the whole layout is predictable and the calendar cells do not require interaction - give all the calculations and the formation of the DOM primitives to the Web Worker. Then in React the entire component can be implemented as a stateless function, forgetting about performance and rendering problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question