reactjs – How to set react routing?

App.js import ‘bootstrap/dist/css/bootstrap.min.css’; import React from ‘react’; import { BrowserRouter, Routes, Route } from ‘react-router-dom’; function App() { return ( <> <BrowserRouter> <Routes> <Route path=”” element={<Home />} /> <Route path=”/student-register” element={<StudentSignup />} /> <Route path=”/staff-register” element={<StaffSignup />} /> <Route path=”/login” element={<Login />} /> <Route path=”/create-group” element={<ProtectedRoute><CreateGroup/></ProtectedRoute>} /> <Route path=”/request-supervisor” element={<ProtectedRoute><RequestSuperVisor/></ProtectedRoute>} /> <Route path=”/request-cosupervisor” element={<ProtectedRoute><RequestCoSuperVisor/></ProtectedRoute>} /> … Read more

reactjs – I’m having errors in both backend and frontend. Koa & React

When I’m going to run the code it gives the following error. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! react-app@1.0.0 start: webpack-dev-server –mode development –open –hot –port 3000 npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the react-app@1.0.0 start script. npm ERR! This is probably not a problem with … Read more

reactjs – Getting Axios from React to Work with Spring Boot + Spring Boot Security

I have created a react app with a spring boot backend but I’m having trouble pulling the data through with axios. I have checked numerous SO posts as well as documentation with spring to no avail. I was initially blocked by CORS but I was able to resolve that with Spring Security. However, spring security … Read more

javascript – Unable to access data passed in through react router

I’m trying to pass in data that I received from my backend to another page on my frontend. I’m using react-router-dom and withRouter to pass my data from the product.js page to the result.js page on the frontend. I keep getting this error though: Uncaught TypeError: Cannot read properties of undefined (reading ‘state’) And the … Read more

reactjs – How to deploy react application on heroku using .gitlab-ci.yml

I have created a React app and used webpack to bundle it. Now I am trying to deploy the app on Heroku. The build is successful but when I try to open the link I get “Application Error”. This is my webpack file import * as webpack from ‘webpack’; import * as webpackDevServer from ‘webpack-dev-server’; … Read more

javascript – ReferenceError: React is not defined – Migrating from CRA to Vite and NX

I’m currently in the process of migrating a create-react-app (CRA-v4) monorepo Webpack setup to an NX Monorepo powered by vite. I’m currently stuck in trying to figure out how to solve the typical Uncaught ReferenceError: React is not defined Which happens whenever a file doesn’t import React directly, but has a named import from it, … Read more