Hi i am working on storybook where i need to pass default data to component from storybook,i am trying to pass data using args and not able to get in state in components.below is my storybook.
const Template = (args) => (
<State>
<Confirmation {...args} />
</State>
);
const story = {
component: Confirmation,
title: "Confirmation",
};
export default story;
export const Default = Template.bind({});
Default.args = {
search_request: {
isTwoWay: true,
}
}
in my component:
const Confirmation = ({ onClick, classes }) => {
const { state } = useContext(StateContext);
const isTwoWay = state.search_request.isTwoWay;
}
how to pass data to state from stories, any help please