A
A
Alexander2014-11-04 13:29:42
React
Alexander, 2014-11-04 13:29:42

How to properly organize the project structure in reactJS?

Should we use anonymous functions in render, or is it better to move them to the component level?
Should ItemComponent and ItemsComponent be placed in different files if the ItemsComponent only contains array.map for items, or should array.map for items be placed in a separate function in itemComponent?
What library is better to use as a model?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Elizaveta Borisova, 2014-11-04
@Elizaveta

I have no React development experience, I only know what their idea was.
Render only generates a view, there should not be any left anonymous functions in it. One of the framework's ideas is that render can be called frequently, and the actual DOM update only happens when it actually changes. In comparison, some gain in performance is achieved.
As for organizing by files, I think it's entirely a matter of convenience/preference.
Library for the model - the question is not clear. Is she needed? Right? Write native + React first, without complicating it with additional libraries, then think about how to improve.
Maybe this article will clarify jspro.ru/post/pervoe-znakomstvo-s-reactjs-ot-facebook a little , but it is for beginners

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question