mirror of
https://github.com/bendtherules/is-nifty-open.git
synced 2026-08-19 00:32:31 +00:00
All components - update correctly on both prop create and update
This commit is contained in:
@@ -21,6 +21,14 @@ export class OpenXDay extends React.Component<OpenXDayProps, {}> {
|
||||
|
||||
constructor(props: OpenXDayProps) {
|
||||
super(props);
|
||||
this.updateFromProps(props);
|
||||
}
|
||||
|
||||
componentWillUpdate(nextProps: OpenXDayProps, nextState: {}) {
|
||||
this.updateFromProps(nextProps);
|
||||
}
|
||||
|
||||
updateFromProps(props: OpenXDayProps) {
|
||||
this.question = props.question;
|
||||
this.xDay = props.xDay;
|
||||
this.allHolidays = props.allHolidays;
|
||||
|
||||
Reference in New Issue
Block a user