jakezatecky / react-checkbox-tree

A simple and elegant checkbox tree for React.

Home Page:https://jakezatecky.github.io/react-checkbox-tree/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: p is undefined node_modules\react-checkbox-tree\lib\index.browser.js

rm-rf42 opened this issue · comments

Describe the bug
node_modules\react-checkbox-tree\lib\index.browser.js appears to be crashing due to "p is undefined" This happens when I attempt to push data to the nodes object. Hardcoded it works, even taking my results from console.log and hard coding it as a new node object works.

Whats strange is if I let the page load while commenting out the part that pushes to the object, and then uncomment. It works perfect. Is there anyway I can troubleshoot this? I am not sure what the variable "p" is that it is referencing.

Reproduction steps
I am not able to reproduce this in the sandbox.

Expected behavior
I am attempting to dynamically add to the nodes object from data I am getting from another source. I can see my new node object when I console.log and it looks correct. In fact when I hard code that it works perfectly.

Screenshots
image

commented

I am modifying the nodes const in a SSR function now instead and this seems to solve this issue.