JesusTheHun / storybook-addon-remix-react-router

Use your app router in your stories. A decorator made for Remix React Router and Storybook
Apache License 2.0
45 stars 11 forks source link

Is there a possibility to support Storybook 7 (beta) ? #18

Closed bastiengrignon closed 1 year ago

bastiengrignon commented 1 year ago

It would be nice to be able to use your addon with Storybook 7.

Would you be able to do it or you're going to wait until Storybook 7 will release a stable version ?

JesusTheHun commented 1 year ago

Hello, to be honest I don't have much time until at least mid-march, and there is already some work to do in order to support data router. I don't know what needs to be done to support storybook v7 and don't have time to investigate. If you have some insight and/or can make a PR I'm more than willing take a look and merge it.

bastiengrignon commented 1 year ago

Ok thanks for the quick response, I completly understand, no problem. I'll look into it if I have a bit of time too :wink:

pellea commented 1 year ago

It's working with the v7. I have those following versions:

    "storybook": "^7.0.0-rc.6"
    "storybook-addon-react-router-v6": "^0.3.4"

One issue that I have, but not sure if related to Storybook v7 or if it was already there in v6: I cannot update props automatically using the UI if withRouter is set in the decorators.

JesusTheHun commented 1 year ago

I've started to take a look into v7. Indeed the addon is not impacted directly. I will still create a new version for SB7 in order to move away from now deprecated APIs, but also in order to harvest the new typescript support !

ldm-acn commented 1 year ago

I found a problem with a peer dependency on @storybook/components@"^6.4.0":

I get this conflict:

@storybook/components@"^6.4.0" from storybook-addon-react-router-v6@0.3.5
@storybook/components@"^7.0.0" from storybook-react-i18next@2.0.1
JesusTheHun commented 1 year ago

I'll publish the new version next Thursday

JesusTheHun commented 1 year ago

@bastiengrignon @pellea @ldm-acn Hi, can you try the canary version ?

npm I -D storybook-addon-react-router-v6@1.3.6--canary.ffa6de3.0 yarn add -D storybook-addon-react-router-v6@1.3.6--canary.ffa6de3.0

bastiengrignon commented 1 year ago

@JesusTheHun I tried but I got an issue on a story with a NavLink component with the following error : Error: useLocation() may be used only in the context of a <Router> component

JesusTheHun commented 1 year ago

@bastiengrignon can you share your story ? This is very likely an issue with your story

bastiengrignon commented 1 year ago

@JesusTheHun Yes sorry I forgot to add the withRouterin my decorators array in the preview.jsx file :roll_eyes: I thought that the addon will do it automatically But now I have another issue when adding the withRouter globally, some styles are changing in my Story :thinking:

JesusTheHun commented 1 year ago

Maybe you should ask on SO ? I don't mind helping but this place is for issues you have identified with the add-on.

bastiengrignon commented 1 year ago

Yes no worries just aking I'll check by myself what's goign on ! Thanks for working on supporting storybook 7 :wink:

JesusTheHun commented 1 year ago

Support for Storybook 7 has been added with version 1.0.0