MCPcopy
hub / github.com/NervJS/nerv / callGetSnapshotBeforeUpdate

Function callGetSnapshotBeforeUpdate

packages/nerv/src/lifecycle.ts:341–350  ·  view source on GitHub ↗
(props, state, inst)

Source from the content-addressed store, hash-verified

339}
340
341function callGetSnapshotBeforeUpdate (props, state, inst) {
342 const { getSnapshotBeforeUpdate } = inst
343 let snapshot
344 errorCatcher(() => {
345 if (isFunction(getSnapshotBeforeUpdate)) {
346 snapshot = getSnapshotBeforeUpdate.call(inst, props, state)
347 }
348 }, inst)
349 return snapshot
350}
351
352function hasNewLifecycle (component) {
353 if (isFunction(component.constructor.getDerivedStateFromProps)) {

Callers 1

updateComponentFunction · 0.85

Calls 2

isFunctionFunction · 0.90
errorCatcherFunction · 0.85

Tested by

no test coverage detected