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

v2 not as expected on react StrictMode? #82

Closed
logankfuller opened this issue Jul 20, 2021 · 7 comments
Closed

v2 not as expected on react StrictMode? #82

logankfuller opened this issue Jul 20, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@logankfuller
Copy link

Describe the bug & Expected behavior
After creating a new project and installing the newest version (2.0.0), the examples do not run, quoting an error: "Uncaught Error: 'Xwrapper' is required around element using 'useXarrow' hook! wrap your xarrows and connected elements with Xwrapper! "

To Reproduce
All I did was create a new project, install the libraries (react-xarrows and react-draggable) and copy/paste the example code.

I did this in CodeSandbox as well: CodeSandbox

Screenshots
Link to Error

@Eliav2
Copy link
Owner

Eliav2 commented Jul 20, 2021

Your are right.. this is very stange; if you will copy and paste the example and replace the code of 'simple example' with this code at will work

@logankfuller
Copy link
Author

Hey,

I've played around with the code a bit, but I'm not quite sure what you're asking. I've copied/pasted various parts and I still get the same error. Can you paste an example?

@Eliav2
Copy link
Owner

Eliav2 commented Jul 20, 2021

see
https://codesandbox.io/s/react-arrows-v2-works-qbpyv?file=/src/index.jsx
seems to work perfectly fine here.

@Eliav2
Copy link
Owner

Eliav2 commented Jul 20, 2021

whatt
strange!
StrictMode breaks v2
https://codesandbox.io/s/react-arrows-v2-strictmode-not-work-ko4ju?file=/src/index.jsx

i have no idea why, but StrictMode that create-react-app uses by default breaks react-xarrows v2.
currently, to resolve just remove the wrapping StrictMode wrapper as a workaround until I will figure it out and would release a patch.

@logankfuller
Copy link
Author

Yeah that seemed to be the fix. Thanks!

whatt
strange!
StrictMode breaks v2
https://codesandbox.io/s/react-arrows-v2-strictmode-not-work-ko4ju?file=/src/index.jsx

i have no idea why, but StrictMode that create-react-app uses by default breaks react-xarrows v2.
currently, to resolve just remove the wrapping StrictMode wrapper as a workaround until I will figure it out and would release a patch.

@Eliav2
Copy link
Owner

Eliav2 commented Jul 22, 2021

Open. This should be fixed

@Eliav2 Eliav2 reopened this Jul 22, 2021
@Eliav2 Eliav2 added the bug Something isn't working label Jul 22, 2021
@Eliav2 Eliav2 changed the title v2 example not working? v2 not as expected on react StrictMode? Jul 24, 2021
@Eliav2
Copy link
Owner

Eliav2 commented Jul 24, 2021

related
facebook/react#21956

@Eliav2 Eliav2 closed this as completed in eada23f Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants