Skip to content
New issue

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

Dependence on a div with id=root #23

Open
kaichiangbain opened this issue Dec 10, 2020 · 2 comments
Open

Dependence on a div with id=root #23

kaichiangbain opened this issue Dec 10, 2020 · 2 comments

Comments

@kaichiangbain
Copy link

Trying to wrap this into a Mendix pluggable widget (a React widget), then place multiple of them in a page.

Noticed the dependency src\chart\index.js ...
const orgChart = document.getElementById('root')

Where "root" is hardcoded, thus I cannot have multiple of these in a single page - I cannot have multiple divs with the same Id.

Make this part of the props passed in?

@Boris-Scharinger
Copy link

Dear Kaichiangbain - very interest in this project. Can we collaborateon the Mendix version? Regards, Boris

@kaichiangbain
Copy link
Author

Sure. I am using the Mendix low code platform (mendix.com), which allows for React pluggable widget (https://docs.mendix.com/howto/extensibility/pluggable-widgets). The widget needs to allow multiple instances of it on the same page/DOM. Mendix also takes control of the DOM, thus widgets cannot arbitrarily apply an ID easily.

Since I am referencing this chart as-is via dependency "@unicef/react-org-chart": "0.3.4", I am trying to fix the hardcoded "root" in the original code. If this fails, I may need to import source code into my widget and change as necessary - definitely not preferable.

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

No branches or pull requests

2 participants