-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(demo) more hook and storybook #388
Conversation
<div className={className}> | ||
<div className="container-fluid container af-title-bar__wrapper"> | ||
{backHome && ( | ||
<Link title="Retour à l'accueil" className="btn af-btn--circle" to="/"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you don't use Link router component ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not working inside my stories ^^
I generaly Never use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you just have to wrap your story by a Router
i think you also create global decorator
const withCustomFetch = fetch => Component => props => { | ||
console.log(fetch,props.environment, Component ); | ||
const withCustomFetch = fetch => Component => ({environment, ...otherProps}) => { | ||
console.log(fetch, environment, Component ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be delete
}; | ||
|
||
export default withCustomFetch(fetch)(HomeContainer); | ||
export default withCustomFetch(fetch)(withRouter(HomeContainer)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composition should be more readable
const items = await fetchDevis(fetch)(); | ||
setState({ | ||
loading: false, | ||
items: items |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shorter
No description provided.