0
I need help using . setState() in if Else after render(), if possible...
render() {
const propsDesign = this.props.design,
propsIcon = this.props.icon,
propsText = this.props.text,
propsDescription = this.props.description;
var object = {
design: propsDesign,
icon: propsIcon,
text: propsText,
description: propsDescription
};
if(propsDesign === 'normal' || propsDesign === 'narrator' || propsDesign === 'error' ) {
console.log("Design true");
this.setState({design: propsDesign});
} else {
console.log("Design false");
this.setState({design: 'error'});
}
return <Container design=??? />;
}
This is Stackoverflow in English, please translate your question.
– leofalmeida
I didn’t even realize it was in Portuguese, but it’s translated
– Leonardo Luiz Gava
No problem, just to keep order ^^
– leofalmeida