Want to use refs to change styling class in ReactJS? Use the below example to use refs to change styling class in ReactJS.
1 2 3 4 5 6 7 | ChangeColor(oColor) { this.props.ChangeColor(oColor); // This is how background will be updated. this.refs.colorPicker.style.background = oColor; }, |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.