Open florinesueur opened 5 years ago
Only when I add addon-jsx, I have this problem.
button.tsx
import './button.style.css'; import * as React from 'react'; interface Props { /** * Text for the button */ text: String; } export const ButtonNew = ({ text }: Props) => { const [value, setValue] = React.useState('...'); console.log(value); return ( <div> <div className="green"> {text} <input type="text" value={value} onChange={({ target }) => setValue(target.value)} /> </div> </div> ); }; ButtonNew.defaultProps = { text: 'ok', };
button.stories.tsx
import * as React from 'react'; import { setAddon, storiesOf } from '@storybook/react'; import JSXAddon from 'storybook-addon-jsx'; setAddon(JSXAddon); import { ButtonNew } from '../src/components/button/button'; storiesOf('Administrator/Button', module).addWithJSX('custom', () => <ButtonNew />);
Did you have the same issue?
Did you find a solution @florinesueur?
@Gabrielmtn no, I did not find a solution and I put this project in standby.
Can you try this again? my projects use many hooks and this addon works fine
Only when I add addon-jsx, I have this problem.
button.tsx
button.stories.tsx
Did you have the same issue?