Create stateless React component with instance
Create stateless React component with instance, to use ref
s, even before React 16.3.
If you are using React 16.3+, you can use React.forwardRef instead.
Example
PureComponent { console } { const children = thisprops const element = ReactChildren const instantiableElement = const nextElement = React return <div className='some-optional-wrapper'> nextElement </div> }
Requirements
Everything is written in ES5. To make it working in IE8, you need polyfills for ES5, especially:
Object.assign
Object.defineProperty
Object.create