![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@chanoch/simple-react-router
Advanced tools
Implementation of a simple react router
This is an implementation of Konstantin Tarkus's alternative to react router from You might not need React Router
In Konstantin's system, an array of routes together with the root level 'page' component that will render the root to the router. This array is used with the history component to integrate with the browser's navigation and redux to support navigation through the application.
To create an application using simple-react-router:
import HomePage from './HomePage';
const routes = [
{ path: '/', action: () => <HomePage /> },
{ path: '/index.html', action: () => <HomePage /> },
];
import {SimpleReactRouter} from '@chanoch/simple-react-router';
const router = new SimpleReactRouter(routes);
You can optionally dispatch a state on loading of application data from the server
The Single Page Application's (SPA's) HTML page is a standard react page which contains the following div to mount the application to:
<div id="root"></div>
The HTML page must also include an import for javascript for your application. I use webpack to bundle my JS and dependencies but I import the files statically into the page - can't remember why. There is a webpack mechanism for injecting the scripts into the page at the end of each page.
The reducers, redux middlware, and action creators are all standard redux mechanisms so you will need to define those according to the redux standards.
// Each page component is imported
import MyComponent from './MyComponentPage';
import React from 'react';
// The link between routes or paths in the application are provided in the path property for
// each object in the routes array.
const routes = [
{ path: '/menuplanner/', action: (store) => <MenuPlanner store={store} /> },
{ path: '/menuplanner/selectmenu.html', action: (store) => <ChooseRecipes store={store}/> },
];
export default routes;
A redux reducer modifies the state according to the state change which just occurred. It shouldn't have side-effects.
export function createMealPlanReducer(state, action) {
return {
...state,
mealPlan: action.mealPlan,
action: CREATE_MEAL_PLAN
}
}
The middlware will be injected with the state and the history object. This means that middlware can both mutate the state and navigate.
FAQs
A simple react router
We found that @chanoch/simple-react-router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.