Calling a component with hooks

node v10.24.1
version: 1.0.2
endpointsharetweet
const React = require('react'); const ReactDOM = require('react-dom/server'); const SomeComponent = () => { React.useEffect(() => {}, []); return React.createElement('div'); }; ReactDOM.renderToString(React.createElement(SomeComponent)); console.log('has prototype?', !!SomeComponent.prototype); SomeComponent();
Loading…

no comments

    sign in to comment