-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnings for importing useId if React < 18 #357
Comments
I have design system which uses React18 and [email protected]. When i use my design library on a React17.x project, i am getting the ERROR as shown below... Seems v5.0.0 is not compatible with React<18. ERROR in ../../node_modules/react-accessible-accordion/dist/es/index.js 548:16-21 |
WARNING in ./node_modules/react-accessible-accordion/dist/es/index.js 548:16-21
export 'useId' (imported as 'useId') was not found in 'react' (possible exports: Children, Component, Fragment, Profiler, PureComponent, StrictMode, Suspense, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, cloneElement, createContext, createElement, createFactory, createRef, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useDebugValue, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, version)
This attempts to import from React:
but
useId
is only in React 18.It would be better to import React and then check if 'useId' is a defined property.
The text was updated successfully, but these errors were encountered: