Fix: Make storybook work with redux

This commit is contained in:
Hristo Nedelkov 2023-08-17 13:06:27 +03:00
parent ec90dfb13a
commit 02b043167b
2 changed files with 18 additions and 8 deletions

View File

@ -31,13 +31,13 @@ const router = createBrowserRouter([
function App() {
return (
<TamaguiProvider config={config}>
<ReduxProvider store={store}>
<ReduxProvider store={store}>
<TamaguiProvider config={config}>
<StatusProvider>
<RouterProvider router={router} />
</StatusProvider>
</ReduxProvider>
</TamaguiProvider>
</TamaguiProvider>
</ReduxProvider>
)
}

View File

@ -1,16 +1,26 @@
import type { Meta, StoryObj } from '@storybook/react'
import { Provider as ReduxProvider } from 'react-redux'
import store from '../../redux/store' // Adjust` the path to your store accordingly
import DeviceHealthCheck from './DeviceHealthCheck'
const meta = {
const meta: Meta = {
title: 'Pages/DeviceHealthCheck',
component: DeviceHealthCheck,
decorators: [
StoryObj => (
<ReduxProvider store={store}>
<StoryObj />
</ReduxProvider>
),
],
tags: ['autodocs'],
} satisfies Meta<typeof DeviceHealthCheck>
}
export default meta
type Story = StoryObj<typeof meta>
export const Page: Story = {
type DeviceHealthCheckStory = StoryObj<typeof DeviceHealthCheck>
export const Page: DeviceHealthCheckStory = {
args: {},
}