Answer the question
In order to leave comments, you need to log in
Is the SAP application logic properly thought out?
There is SAP, it is necessary that there is a form for filling in data, and a result component on the same page, dynamically updated depending on the entered data.
Form : There are dynamic questions that come with the database. For each answered question, a request is sent back to the database, where the data for the result component comes.
I just got to redux and don't know all the possibilities yet, so please point me in the right direction.
I do it like this. Each question block in the form has its own template
const items = requirements.map((item)=> <RadioButtons handlerFormClick={this.handlerFormClick} dispatchRequires={this.dispatchRequires} key={item.cli_id} id={item.cli_id} name={item.cli_name} desc={item.desc}/>)
onRadioBtnClick(rSelected) {
this.setState({ rSelected },this.props.handlerFormClick());
}
handlerFormClick(){
console.log( this.formRef.current[0].className)
}
Answer the question
In order to leave comments, you need to log in
Correctly work with the state, and not calculate it from data from the DOM.
Storing form state in a Redux store doesn't make much sense.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question