Home > Software design >  ReactJS changing styles with const strings
ReactJS changing styles with const strings

Time:12-16

Hi I am trying to change the styles of a component using a const string but it does not work. May I know why this approach is wrong?

 style={{ color: {newColor} }}

CodePudding user response:

No need to use brackets again

style={{ color: newColor }}
  • Related