facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.67k stars 26.84k forks source link

React - Component link - Broken - bug #13487

Open kshitiz305 opened 9 months ago

kshitiz305 commented 9 months ago

Describe the bug

Link for the https://neutrino.js.org/packages/react-components/ need to be changed as it is giving 404 error.

Did you try recovering your dependencies?

(Write your answer here.)

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

(paste the output of the command here.)

Expected behavior

(Write what you thought would happen.)

Actual behavior

image

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

rayenhidri27 commented 9 months ago

error when i use the Link component

i have an error when i use the Link component from react-router-dom i work on a new project on react 18 - router v6 this my test component

import { Link } from 'react-router-dom'

const Test = () => {
  return (
   <Link to="/">test</Link>
  );
}

export default Test

and this is my package.json

{
  "name": "e-commerce-perso",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@popperjs/core": "^2.11.8",
    "@reduxjs/toolkit": "^2.0.1",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "axios": "^1.6.2",
    "bootstrap": "^5.3.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^6.21.1",
    "react-scripts": "5.0.1",
    "react-toastify": "^9.1.3",
    "uuid": "^9.0.1",
    "web-vitals": "^2.1.4"
  },
rayenhidri27 commented 9 months ago

Links work in other components, just avoid to use it in the app component (in the return of the app) even if you include it another component and you include it in app, it's the same issue put links in components , and in app, put only the router like

function App() {
  const router = createBrowserRouter(
    createRoutesFromElements(
      <>
        <Route path="/" element={<App />} />
        <Route path="/test" element={<Test />} />
        <Route path="/testxx" element={<TestXX />} />
      </>
    )
  );
  return (
    <div className="App">
      <RouterProvider router={router}></RouterProvider>
    </div>
  );
}

export default App;

nested routes should work also