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:
@@ -19,6 +19,14 @@ export class NextOpenCloseMini extends React.Component<NextOpenCloseMiniProps, {
|
||||
|
||||
constructor(props: NextOpenCloseMiniProps) {
|
||||
super(props);
|
||||
this.updateFromProps(props);
|
||||
}
|
||||
|
||||
componentWillUpdate(nextProps: NextOpenCloseMiniProps, nextState: {}) {
|
||||
this.updateFromProps(nextProps);
|
||||
}
|
||||
|
||||
updateFromProps(props: NextOpenCloseMiniProps) {
|
||||
this.xDay = props.xDay;
|
||||
this.openOrClose = props.openOrClose;
|
||||
this.allHolidays = props.allHolidays;
|
||||
|
||||
Reference in New Issue
Block a user