Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Lodash error #227

Open
rachelaroberts opened this issue Aug 5, 2019 · 2 comments
Open

Lodash error #227

rachelaroberts opened this issue Aug 5, 2019 · 2 comments

Comments

@rachelaroberts
Copy link

Hello, when I try to view my treebeard component in chrome, I receive the following the error in the console:

TypeError: (0, _lodash.castArray) is not a function (bundle.js:1235)
at TreeBeard (bundle.js:90263)

I’ve tried updating some dependencies to their latest versions, but it is still occurring. Does anyone know where this could be coming from?

Thank you in advance!

@maximilianoforlenza
Copy link
Collaborator

maximilianoforlenza commented Aug 18, 2019

Hi @rachelaroberts ! Could you please upload an example? (codesanbox)

Thanks

@MicroDev92
Copy link

MicroDev92 commented Mar 22, 2021

Hi, I have been having the same issue since recently, I haven't updated or modified my code, it worked for a year up until now....
IMPLEMENTATION:
const TreeExample = (props) => {
const [counter, setCounter] = useState(0);
const [data, setData] = useState({});
const [cursor, setCursor] = useState(false);

useEffect(() => {
const getUsers = async () => {
const result = await axios(
"example.org/data"
);
let pom = result.data[0];
setData(pom);
};
getUsers();
}, []);

const onToggle = (node, toggled) => {

if (cursor) {
  cursor.active = false;
}
node.active = true;
if (node.children) {
  node.toggled = toggled;
}
setCursor(node);
setData(Object.assign({}, data));

};

return Treebeard data={data} onToggle={onToggle} ;
};
as I said, this worked for a year until a few days ago...
P.S. I intentionally removed enclosing tags in return statement because it wasn't visible.
P.P.S. Also tried with Your demo data and the same error is returned

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants