This React app changes the background color of a box on the click of a button. Also, the respective hex code is shown inside of the box. The default background color is white.
- Use
import
instead ofrequire
to importrandomcolor
- Only declare
randomizedColor
in the scope where it is needed - Use the object shorthand syntax (eg. instead of
{ name: name }
, in newer versions of JavaScript you can write{ name }
and it will be the same!) - Style the box using a class instead of an id