If you have not programmed several apps with React, your first
inclination is usually going to be to try to use refs to "make things
happen" in your app. If this is the case, take a moment and think
more critically about where state should be owned in the
component hierarchy. Often, it becomes clear that the proper
place to "own" that state is at a higher level in the hierarchy. Placing
the state there often eliminates any desire to use refs to "make
things happen" – instead, the data flow will usually accomplish your
goal.
Please provide a plentiful, exhaustive pool of examples of various patterns in code where refs are initially used to "make things happen", and subsequent refactorings into the right way of doing things with zero loss of functionality.
At https://facebook.github.io/react/docs/more-about-refs.html :
Please provide a plentiful, exhaustive pool of examples of various patterns in code where refs are initially used to "make things happen", and subsequent refactorings into the right way of doing things with zero loss of functionality.