Skip to content

Update 'setProps' usage and comments in boilerplate #65

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

Merged
merged 2 commits into from
Mar 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,18 @@ export default class {{cookiecutter.component_name}} extends Component {
ExampleComponent: {label} 
<input
value={value}
onChange={e => {
onChange={
/*
* Send the new value to the parent component.
# setProps is a prop that is automatically supplied
* setProps is a prop that is automatically supplied
* by dash's front-end ("dash-renderer").
* In a Dash app, this will send the data back to the
* Python Dash app server.
* If the component properties are not "subscribed"
* to by a Dash callback, then Dash dash-renderer
* will not pass through `setProps` and it is expected
* that the component manages its own state.
* In a Dash app, this will update the component's
* props and send the data back to the Python Dash
* app server if a callback uses the modified prop as
* Input or State.
*/
if (setProps) {
setProps({
value: e.target.value
});
} else {
this.setState({
value: e.target.value
})
}
}}
e => setProps({ value: e.target.value })
}
/>
</div>
);
Expand Down