Make Your React Components Pretty 💅
Mark Brouch
50426

  • When refs are used

I don’t know if this counts as pretty but how about calling back the ref?

// SFC
const Input = ({ onRef, value }) => (
<input ref={onRef} value={value} type="text" />
)
// use the ref in a component
render() {
return <Input onRef={input => input.focus()} value="Fake ref" />
}