New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cra-template-07

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cra-template-07 - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

template/src/components/Layout/Home.jsx

2

package.json
{
"name": "cra-template-07",
"version": "2.0.4",
"version": "2.0.5",
"proxy": "https://localhost:44332/",

@@ -5,0 +5,0 @@ "keywords": [

@@ -11,2 +11,3 @@ import React, { useContext } from "react";

import Page from "components/Layout/Page";
import Home from "components/Layout/Home";
import DevMode from "components/Dev/DevMode";

@@ -33,9 +34,17 @@

<Routes>
{routes?.map((page) => (
<Route
path={page.url}
key={page.url + "route"}
element={<Page page={page} />}
/>
))}
{routes?.map((page) =>
page.isRoot ? (
<Route
path={page.url}
key={page.url + "route"}
element={<Home page={page} />}
/>
) : (
<Route
path={page.url}
key={page.url + "route"}
element={<Page page={page} />}
/>
)
)}
</Routes>

@@ -42,0 +51,0 @@

@@ -38,6 +38,7 @@ import React, { createContext, useState, useEffect } from "react";

if (data?.children) {
setRoutes((routes) =>
Array.isArray(routes)
? [...routes, ...data.children]
: [data, ...data.children]
setRoutes(
(routes) =>
Array.isArray(routes) // If routes is array
? [...routes, ...data.children] // Merge both routes and children into new array
: [{ ...data, isRoot: true }, ...data.children] // If routes is not array, initiate array with root and children
);

@@ -44,0 +45,0 @@ data.children.forEach((singleNode) => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc