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

Checkbox tree does not work after minification

Euticus opened this issue · comments

Describe the bug
The component works fine when I run it alone, but when I run it in a production environment it does not execute the onCheck function.

Reproduction steps
node v16.14.2
react: "^17.0.2",
react-dom: "^17.0.2",
react-checkbox-tree: "^1.7.2"

  1. The checkbox is part of a component with a form that is utilizing the useForm() hook
  2. checked and expanded set via useState()
  3. When using yarn start the component loads the correctly in a dev environment
  4. run yarn run build and using the minified version in a production environment, the checkbox tree does not execute any logic within onCheck or onExpand (I tried a console.log here and it did not log anything)

Expected behavior
The component should perform identical between dev and production environments.

seeing the same issue unable to see checkbox tree in production in our project. we are seeing the blank page in prod, while in local we are able to see the checkbox tree.

Can you provide a little more context on your build tools, or can you provide repo that showcases this issue?

For example, I know there were some issues with Create React App a while back, but that does not appear to be the case with the latest version of CRA and this library.

The Webpack config for this project minifies prior to pushing it to npm due to the mode being set to 'production'. I suspect that setting it to 'none' may help resolve any issue you are facing, but without being able to recreate that environment, it's just a guess.

Closing due to lack of activity.