React Redux Architecture Suggestion
Confussed between which is best to use react class state or redux state for
onChange operation of the form elements.
I have a form for entering,displaying user details, I am using
react-redux architecture, on-change or on-load I am populating the data from the api to the respective text boxes using the class state/localstate, when the user inputs any data I am using the
setState . I came to know that there is another way to do it by dispatching an action and storing the data in the
redux state instead of local state,so please suggest me which is the standard way to do it, as some prefer not to use local state.
It is generaly as @sebastienbarbier suggested. If you don't need to share your state between different parts of application, the react state is usually better.
I am using the react state for handling onChange for controlled components (typically text inputs). And a redux action is created (and store updated) once when I submit a form.
- → Import statement and Babel
- → should I choose reactjs+f7 or f7+vue.js?
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → .tsx webpack compile fails: Unexpected token <
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → React Native with visual studio 2015 IDE
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
- → How do I determine if a new ReactJS session and/or Browser session has started?
- → Alt @decorators in React-Native
- → How to dynamically add class to parent div of focused input field?