I am working on an Electron-React
app. I have some limited experience with React
. So I am thinking about how to structure my app before I start coding. My app is really simple, it does not need to store anything persistently, so I do not require to use any storage Redux
or db
. I have read on a Reddit post, that a good practice is to separate the components into Controller
and View
components. In this manner, I can have states and logic in Controller
components that is passed down to View
components. I understand how to do something like this. Thinking about my use case, however, I am wondering how I could pass back the data from the View
component to the Controller
.
For example, there is an input text field on the front-end and a button, when the button is clicked, View
component has to send the data from the input text field back to the Controller
, which does some computations and sends back the outputs to View
. So I am unsure about this communication life-cycle once some event happens in the View
component and how to propagate it back up and then down again?