Reputation: 163
i am asking this question to understand better how to implement using react js.
i am just getting started with react js (so excuse me if this question is rather stupid)
for much of the tutorial that i see, i have noticed that everything in the web page is defined as component, also when part of the page can be static html.
i want to know if this is the best approach, or if it's better to just insert my react components only inside DIV's that have some "dynamic data"/user interaction.
i have a couple things in mind
thank you
Upvotes: 1
Views: 360
Reputation: 1283
I personally avoid mixing and matching architectures, for the sake of simplicity. My point being, that I want the design to be consistent within my app, rather than doing certain things one way, and others another way.
When you mention "before any data has arrived" are you referring to an ajax call? If so, this is a great way to do it: https://facebook.github.io/react/tips/initial-ajax.html
This will allow the page to render before the ajax call has been submitted, but will automatically update it once the data is available (something that react does a great job at). By doing so, I would also avoid using static html (placing html in an html file, rather than inside the jsx).
Upvotes: 1