I am trying use rc-time-picker,but i am getting following error
Please check below error,what i am getting
Align.js:88 Uncaught TypeError:
react__WEBPACK_IMPORTED_MODULE_0___default.a.useRef is not a
function
at Align (Align.js:88)
at updateForwardRef (react-dom.development.js:13581)
at beginWork (react-dom.development.js:14402)
at performUnitOfWork (react-dom.development.js:16627)
at workLoop (react-dom.development.js:16667)
at HTMLUnknownElement.callCallback (react-dom.development.js:107)
at Object.invokeGuardedCallbackDev (react-dom.development.js:144)
at invokeGuardedCallback (react-dom.development.js:191)
at replayUnitOfWork (react-dom.development.js:16042)
at renderRoot (react-dom.development.js:16724)
at performWorkOnRoot (react-dom.development.js:17352)
at performWork (react-dom.development.js:17274)
at performSyncWork (react-dom.development.js:17247)
at interactiveUpdates$1 (react-dom.development.js:17528)
at interactiveUpdates (react-dom.development.js:2248)
at dispatchInteractiveEvent (react-dom.development.js:4749)
The useRef Hook is a function that returns a mutable ref object whose . current property is initialized with the passed argument ( initialValue ).
“useRef” React Hook can be used to create Uncontrolled Elements. These elements can be accessed using the DOM Reference. While creating an Uncontrolled Element, we use the keyword “ref”, which points out to a reference object, storing the DOM reference of the elements rendered in the component.
The useRef is a hook that allows to directly create a reference to the DOM element in the functional component. Syntax: const refContainer = useRef(initialValue); The useRef returns a mutable ref object.
useRef is a React Hook It was introduced only in React 16.8.
Upgrade your React (and React DOM) to anything after 16.8 and try again.
Sources : https://reactjs.org/docs/hooks-intro.html
"Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class." -FROM THE DOCS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With