projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.45k stars 1.16k forks source link

fix: default link widget with react strict mode #1014

Closed marian2js closed 4 months ago

marian2js commented 10 months ago

Checklist

What, why and how?

Solves #598, #618, #653, and #967 (the closed ones are closed with the workaround of removing strict mode).

React Strict Mode is recommended on production, DefaultLinkWidget was changing the component's state on render, which is not recommended by React. I refactored the component to use hooks, so now can be used with strict mode.

Feel good image:

LOL

changeset-bot[bot] commented 10 months ago

🦋 Changeset detected

Latest commit: 20766f539e81279344d5e1a7646cf7c2815e1835

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages | Name | Type | | ------------------------------------- | ----- | | @projectstorm/react-diagrams-defaults | Patch | | @projectstorm/react-diagrams-routing | Patch | | @projectstorm/react-diagrams | Patch | | @projectstorm/react-diagrams-gallery | Patch | | @projectstorm/react-diagrams-demo | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

igorhaf commented 9 months ago

Hello @marian2js Could you help me? How would I include your fork into my project? I've tried several ways, pulling the npm from your git, but the library is not recognized in the code as a package.

kale1d0code commented 9 months ago

Hello @marian2js Could you help me? How would I include your fork into my project? I've tried several ways, pulling the npm from your git, but the library is not recognized in the code as a package.

Without having the pull request go through, I think the best way would be to use pnpm and copy all the code as packages within a monorepo. or create new npm packages from the fork under a different name

abhishek-doe commented 4 months ago

Hello @marian2js Could you help me? How would I include your fork into my project? I've tried several ways, pulling the npm from your git, but the library is not recognized in the code as a package.

Without having the pull request go through, I think the best way would be to use pnpm and copy all the code as packages within a monorepo. or create new npm packages from the fork under a different name

can you help me about doing with the steps of doing it, I don't know much changeset and how do i use these in my library?

ericlarssen commented 4 months ago

@dylanvorster would it be possible to get this pr reviewed?

dylanvorster commented 4 months ago

Sorry this took so long everyone, and thanks for the work on this PR :)

ericlarssen commented 4 months ago

Thanks so much!

ericlarssen commented 4 months ago

@dylanvorster I think this may have broken links altogether. Something must have changed when pulling in the newer versions of core and canvas in the same release.

dylanvorster commented 4 months ago

I did check each PR on my own machine with storybook, lemme take another look

dylanvorster commented 4 months ago

looks like the custom demos are broken, but the gallery (which is deployed automatically on release) seems to work, @ericlarssen can you elaborate a bit?