![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.
@valu/trees
Advanced tools
Javascript/TypeScript utility to turn WordPress like flat list (child -> parent relation) of hierarchical items to a tree data structure
Javascript/TypeScript utility to turn WordPress like flat list (child -> parent relation) of hierarchical items to a tree data structure.
npm install @valu/trees
Example:
import { flatListToTrees } from "@valu/trees";
const list = [
{
name: "Parent",
id: 1,
parent: 0,
},
{
name: "Child 1",
id: 2,
parent: 1,
},
{
name: "Child 2",
id: 3,
parent: 1,
},
{
name: "Grandchild",
id: 4,
parent: 3,
},
];
const trees = flatListToTrees(list, {
getId: (item) => item.id,
getParentId: (item) => item.parent,
});
will yield trees
as
[
{
node: { name: "Parent", id: 1, parent: 0 },
children: [
{ node: { name: "Child 1", id: 2, parent: 1 }, children: [] },
{
node: { name: "Child 2", id: 3, parent: 1 },
children: [
{
node: { name: "Grandchild", id: 4, parent: 3 },
children: [],
},
],
},
],
},
];
This makes it easy to build recursive menu tree components in React
function MenuTree(props: { trees: typeof trees }) {
return (
<div>
{props.trees.map((tree) => (
<div style={{ marginLeft: "1rem" }}>
<div>{tree.node.name}</div>
<MenuTree trees={tree.children} />
</div>
))}
</div>
);
}
which will render roughly to:
Parent
Child 1
Child 2
Grandchild
FAQs
Javascript/TypeScript utility to turn WordPress like flat list (child -> parent relation) of hierarchical items to a tree data structure
The npm package @valu/trees receives a total of 40 weekly downloads. As such, @valu/trees popularity was classified as not popular.
We found that @valu/trees 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.