snapguidist
snapguidist copied to clipboard
Add support for React 16.8 hooks
Snapguidist throws an error in the browser console when we load a React.FunctionComponent with hooks in React Styleguidist. It doesn't break the compilation but throws an error onto the console.
React 16.8 was released just a day ago along with the hooks and snapguidist should add support for it as we are moving from class based components to function based components and hooks are necessary for adding state to the components.

Without the snapguidist it works perfectly so I presume it's got to be a problem with either snapguidist or one of its dependencies.
Example:
import React, { useState } from 'react'
...
const Comp: React.FC<IComp> = props => {
...
const [state, setState] = useState(0);
return <div onClick={() => { setState(state + 1) }}>{state}</div>;
};
This will throw the same error shown above
Any progress on this one?
need support react-styleguidist v9.x.x pls
Probably obvious, but FYI to those who are looking, you can do this instead:
Input component
```js
const Test = () => {
const [value, setValue] = require('react').useState('')
return (<Input value={value} onChange={ev => setValue(ev.target.value)} />)
}
<Test />