(nextProps: ClassAttributes<any>, nextState: any)
| 235 | } |
| 236 | |
| 237 | function observerSCU(nextProps: ClassAttributes<any>, nextState: any): boolean { |
| 238 | if (isUsingStaticRendering()) { |
| 239 | console.warn( |
| 240 | "[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side." |
| 241 | ) |
| 242 | } |
| 243 | // update on any state changes (as is the default) |
| 244 | if (this.state !== nextState) { |
| 245 | return true |
| 246 | } |
| 247 | // update if props are shallowly not equal, inspired by PureRenderMixin |
| 248 | // we could return just 'false' here, and avoid the `skipRender` checks etc |
| 249 | // however, it is nicer if lifecycle events are triggered like usually, |
| 250 | // so we return true here if props are shallowly modified. |
| 251 | return !shallowEqual(this.props, nextProps) |
| 252 | } |
| 253 | |
| 254 | function createObservablePropDescriptor(key: "props" | "state" | "context") { |
| 255 | return { |
nothing calls this directly
no test coverage detected