New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

easy-router-react

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-router-react

easy router react

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source
npm install easy-router-react

or

yarn add easy-router-react

Usage

remember react-router-dom is required!!

Step 1

index.js

import { BrowserRouter } from "react-router-dom";

ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
  <React.StrictMode>
    <BrowserRouter>
        <App />
    </BrowserRouter>
  </React.StrictMode>
Step 2

routes.jsx

const routes = {
  // pages
  "/": <Home /> /*__ http://localhost:3000 __*/,
  "/signin": <SignIn /> /*__ http://localhost:3000/signin __*/,

  // If sub pages
  "/profile": {
    element: <ProfileLayout /> /*__ http://localhost:3000/profile  __*/,
    sub_pages: {
      "/": <Profile /> /*__ http://localhost:3000/profile __*/,
      orders: <MyOrders /> /*__ http://localhost:3000/profile/orders  __*/,
      settings: <Settings /> /*__ http://localhost:3000/profile/settings  __*/,
    },
  },

  // Put NotFound Component Here
  "*": <div>404 Not Found</div>,
};

export default routes;

App.jsx

import EasyRouter from "easy-router-react";
import routes from "./routes";

export default function App() {
  return (
    <>
      <header>Header</header>
      <EasyRouter routes={routes} />
      <footer>Footer</footer>
    </>
  );
}

Keywords

react router dom

FAQs

Package last updated on 18 Mar 2023

Did you know?

Socket

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.

Install

Related posts