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

Override parent props #8

Merged
merged 5 commits into from
Dec 19, 2017
Merged

Override parent props #8

merged 5 commits into from
Dec 19, 2017

Conversation

JakeSidSmith
Copy link
Contributor

@JakeSidSmith JakeSidSmith commented Dec 19, 2017

By reordering the precedence of the store vs parent props we allow users to pass initial props from the parent, and override them with setProps.

<Counter count={INITIAL_VALUE} />
function getInitialProps ({ count }: OwnProps) {
  return {
    count
  };
}
this.props.setProps({
  count: count + 1
});

This PR additionally pins & updates our tsconfig.

@JakeSidSmith JakeSidSmith merged commit 9821f39 into master Dec 19, 2017
@JakeSidSmith JakeSidSmith deleted the override-parent-props branch December 19, 2017 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants