While it might make sense for the sake of the example, I believe there are more idiomatic ways to achieve the same behaviour in react without using a ref.
Typically you'd pass event handlers to the react element directly and update a variable in state to determine which classes to use.
While it might make sense for the sake of the example, I believe there are more idiomatic ways to achieve the same behaviour in react without using a ref.
Typically you'd pass event handlers to the react element directly and update a variable in state to determine which classes to use.
Agree! I believe Netflix has a rule to never use references.
If you can use state and props, use those