Last active
August 27, 2018 20:29
-
-
Save jamesreggio/01a676fd1655e9e7296f075bce4de72e to your computer and use it in GitHub Desktop.
Example showing the component type object returned from React.forwardRef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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