Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  5] [ 5]  / answers: 1 / hits: 5771  / 4 Years ago, wed, march 18, 2020, 12:00:00

I am testing a react app with storybooks. For some reason my custom story is not loading properly. If I write my custom story in 1-Button.stories.js is renders but if its in 2-MyFunction.stories.js, it doesn't render



In the src/stories directory, I have 3 files:



0-Welcome.stories.js



1-Button.stories.js



2-MyFunction.stories.js



This is my .storybook/main.js:



  stories: ['../src/**/*.stories.js'],//similar to config.js
addons: [//similar to addons.js
'@storybook/preset-create-react-app',
'@storybook/addon-actions',
'@storybook/addon-links',
],
};


Here is the MyFunction.stories.js:



import MyFunction from '../Components/MyFunction;

export const Functiontest = () => <MyFunction .../>;

More From » reactjs

 Answers
4

I didn't include the code for the tab name



export default {
title: 'function'
};
...

export const functiontest = () => {
return <My function ...>
}

[#4457] Sunday, March 15, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
breap

Total Points: 606
Total Questions: 96
Total Answers: 108

Location: Djibouti
Member since Sun, Feb 27, 2022
2 Years ago
breap questions
Thu, Jun 24, 21, 00:00, 3 Years ago
Mon, Oct 7, 19, 00:00, 5 Years ago
Wed, Sep 18, 19, 00:00, 5 Years ago
;