Skip to content
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

Merged
merged 1 commit into from
Sep 25, 2019
Merged

refactor(demo) more hook and storybook #388

merged 1 commit into from
Sep 25, 2019

Conversation

guillaumechervetaxa
Copy link
Contributor

No description provided.

<div className={className}>
<div className="container-fluid container af-title-bar__wrapper">
{backHome && (
<Link title="Retour à l'accueil" className="btn af-btn--circle" to="/">
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor

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 );
Copy link
Contributor

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));
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shorter

@mergify mergify bot merged commit e6bcce1 into master Sep 25, 2019
@delete-merged-branch delete-merged-branch bot deleted the refactor/demo branch September 25, 2019 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants