Solution header icon

Storybook error: Cannot destructure property ‘basename’ of ‘React2.useContext(…)’

You need to add code mentioned in bold to your Storybook component file.
Generally this error raises when you use react-router-dom context provider components like Link etc.
// Other code
export default {
decorators: [
(Story: any) => (
{/* Add any other context providers here */}
tags: [“autodocs”],
// Rest of the code



Related to

ReactJS, Storybook

logo of theitoons

Need professional assistance?

Get a response in less than 24 hours

Let's talk

Get a quote in less than 24 hours