react-typical icon indicating copy to clipboard operation
react-typical copied to clipboard

Error: React.useRef is not a function

Open logivity opened this issue 2 years ago • 1 comments

Getting error trying to use simple use case.

Typescript throwing error when trying to import Typical

Could not find a declaration file for module 'react-typical'. 'd:/Websites/AAG Innovations/V3/aag-innov-v3-0/node_modules/react-typical/dist/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/react-typical if it exists or add a new declaration (.d.ts) file containing declare module 'react-typical';ts(7016)

logivity avatar Dec 22 '22 20:12 logivity

Think you're using a server component in React 18. Try declaring "use client"; at the top of the component. You could wrap the Typical component in your own wrapper component, if you don't want the whole page/component to be a client component.

birkj avatar Feb 15 '23 21:02 birkj