goatslacker / alt

Isomorphic flux implementation
http://alt.js.org/
3.45k stars 322 forks source link

Refs, "making things happen" - please SHOW HOW #658

Closed rulatir closed 8 years ago

rulatir commented 8 years ago

At https://facebook.github.io/react/docs/more-about-refs.html :

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.

taion commented 8 years ago

This doesn't have anything to do with Alt.

rulatir commented 8 years ago

Jesus, what a blunder. Wrong browser tab. Sorry!