We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this my code given by the reference but shows he error
import React, { useEffect, useState } from 'react'; import FolderTree from 'react-folder-tree';
// Polyfill for the self object
const Custom = () => { const [treeState, setTreeState] = useState(null);
const treeData = { name: 'root [half checked and opened]', checked: 0.5, isOpen: true, children: [ { name: 'children 1 [not checked]', checked: 0 }, { name: 'children 2 [half checked and not opened]', checked: 0.5, isOpen: false, children: [ { name: 'children 2-1 [not checked]', checked: 0 }, { name: 'children 2-2 [checked]', checked: 1 }, ], }, ], };
useEffect(() => { setTreeState(treeData); }, []);
return (
export default Custom;
The text was updated successfully, but these errors were encountered:
Hi man I think you use nextjs.
import dynamic from "next/dynamic"; const FolderTree = dynamic(() => import("react-folder-tree"), { ssr: false });
Please refer above codes.
Sorry, something went wrong.
No branches or pull requests
this my code given by the reference but shows he error
import React, { useEffect, useState } from 'react';
import FolderTree from 'react-folder-tree';
// Polyfill for the self object
const Custom = () => {
const [treeState, setTreeState] = useState(null);
const treeData = {
name: 'root [half checked and opened]',
checked: 0.5,
isOpen: true,
children: [
{ name: 'children 1 [not checked]', checked: 0 },
{
name: 'children 2 [half checked and not opened]',
checked: 0.5,
isOpen: false,
children: [
{ name: 'children 2-1 [not checked]', checked: 0 },
{ name: 'children 2-2 [checked]', checked: 1 },
],
},
],
};
useEffect(() => {
setTreeState(treeData);
}, []);
return (
{treeState && (
<FolderTree data={treeState} onChange={(state, event) => setTreeState(state)} />
)}
);
};
export default Custom;
The text was updated successfully, but these errors were encountered: