Quantcast
Channel: Cannot set property 'color' of undefined getting this error in React - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by lissettdm for Cannot set property 'color' of undefined getting this...

If you want to update the color property, add styling_text object to the component state:class InlineDynamic extends React.Component { constructor() { super(); this.state = { styling_text: { color:...

View Article



Answer by Musa for Cannot set property 'color' of undefined getting this...

Declare styling_text outside of renderclass InlineDynamic extends Component{ changeColor = () =>{ this.styling_text.color="black" }; styling_text = {color:"red"}; render(){ return(<div><h1...

View Article

Cannot set property 'color' of undefined getting this error in React

I am trying to change colour of text in h1 tag when I click button. I am calling change colour function but when onclick it executes at that time it is showing error in the inside statement [...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images