'Storybook configuration for state and firebase
Hi i am using storybook in react, For me i am facing issue in configuring firebase and state in storybook, Firebase is getting null in components when i run yarn storybook and passing state is also not possible from storybook to component where i am using context in my component, and able to pass data but not state. Below is my sample storybook:
import React from "react";
import State from "../../../context/providers/State";
import ProcessingBooking from "../../../components/Find/ProcessingBooking";
const Template = (args) => (
<State>
<ProcessingBooking {...args} />
</State>
);
const story = {
component: ProcessingBooking,
title: "ProcessingBooking",
};
export default story;
export const Default = Template.bind({});
Default.args = {
search_request: {
isTwoWay: true,
},
user_session: {
email: "[email protected]",
}
};
In my component if i try to access, i am getting initial state where i defined in initial state file but not from storybook, how to override from stortybook. compoinent sample:
const Confirmation = () => {
const { state } = useContext(StateContext);
const user_session = state.user_session;
}
here i am getting user_session from initial state not from storybook,How to get state from storybook any help please
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
