Q
Q
qfrontend2018-10-30 13:08:12
React
qfrontend, 2018-10-30 13:08:12

How are websites made with React?

Greetings :)
Please tell me how websites are made on React? And what sites is it for?
Let's say there is a site with a catalog with filters, sliders, product galleries, and a menu. How do these sites use React?
Do the main layout and add separate components to it (catalogue with filters, sliders, product galleries)?
Or is the whole page at once, together with the layout, initially this is some kind of global component? And already in it separate "subcomponents" ?
How do components interact with each other (change each other's state )? Through a global/parent component ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Spirin, 2018-10-30
@qfrontend

The question can be rephrased as What are front-end frameworks used for? . The answer to it is easily searched for by a search engine.
Answers to all your questions specifically about React are in the tutorial and documentation on the
official website . Do not be lazy and take the time to familiarize yourself.

M
mr_molodoy, 2018-10-30
@mr_molodoy

They make the main layout and add individual components to it

Yes.
Also yes.
Look at the task.
If you have only part of the page dynamic and dependent on some state, then no one bothers you to make a react component only for this part of the page, and leave the static content static.
But I'm always more inclined towards the second option and consider it more correct (just not when it would create more problems).
Read about Redux.
In general, you are free to do as you see fit.
React is just a view of the application and it only needs (but doesn't have to) know how to render the component, but the components themselves don't need to store any application business logic.
For example, we use React in parallel with Backbon's collections and models, we also manipulate them, and react only displays their state and redraws them when they are updated.
There are ready-made libraries for such a bundle (for example, here https://github.com/magalhas/backbone-react-component), we really wrote for ourselves.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question