Skip to content
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

[help wanted] Issues with CRA & React 16 #361

Open
L-Triple-O opened this issue May 3, 2023 · 0 comments
Open

[help wanted] Issues with CRA & React 16 #361

L-Triple-O opened this issue May 3, 2023 · 0 comments

Comments

@L-Triple-O
Copy link

This package is not compiling when added to a new CRA project using React 16.14.

Using Node LTS 18.16.0 & NPM 9.5.1 We get the following error

Attempted import error: 'useId' is not exported from 'react' (imported as 'useId').

  • Started a new react app via npx create-react-app my-app with Node v18.16.0
  • deleted the node_modules folder and package-lock.json file
  • Updated package.json dependency versions and added Yext packages.
"@testing-library/jest-dom": "^5.15.0",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"@yext/search-ui-react": "^1.1.0",
"@yext/search-headless-react": "^2.1.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
  • Updated index.js to adapt back to React 16
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';

const root = document.getElementById('root');
ReactDOM.render(
    <App />,
    root
);

  • Ran npm run build
  • Error happens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant