Closed emad-ms closed 1 year ago
AFAICT the SB team says you should not use this hook inside a React component. It's unclear why should support this, or how
I couldn't find anything regarding using useArgs()
inside a Story as a bad practice. But even if you don't use it inside a story and just use it in an AddOn still the AddOn will have the same issue.
What do you expect me to do ?
withRouter
is not lettinguseArgs()
work in Storybook 7. Here are two discussions for issues within storybook 7 that looks related: https://github.com/storybookjs/storybook/issues/12006#issuecomment-1553891230 https://github.com/storybookjs/testing-react/issues/30#issuecomment-1542479018It seems the reason can be the way
story()
is being called and it's not being called like a React node so it loses its args state. https://github.com/JesusTheHun/storybook-addon-react-router-v6/blob/0b95fa7465ce4269051645dbfa0138c99f98f2d4/src/withRouter.tsx#LL44C9-L44C44