Skip to content

Instantly share code, notes, and snippets.

@jamesreggio
Last active August 27, 2018 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesreggio/01a676fd1655e9e7296f075bce4de72e to your computer and use it in GitHub Desktop.
Save jamesreggio/01a676fd1655e9e7296f075bce4de72e to your computer and use it in GitHub Desktop.
Example showing the component type object returned from React.forwardRef
const WrappedInput = React.forwardRef((props, ref) => (
<input ref={ref} {...props} />
));
console.log(WrappedInput);
// => Object {
// $$typeof: Symbol(react.forward_ref),
// render: (props, ref) => <input ref={ref} {...props} />,
// }
console.log(typeof WrappedInput);
// => 'object'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment