Skip to content

Latest commit

 

History

History

applyDerivedStateFromProps

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
function applyDerivedStateFromProps(workInProgress, getDerivedStateFromProps, nextProps) {
  let prevState = workInProgress.memoizedState
  let partialState = getDerivedStateFromProps(nextProps, prevState) || {}
  let memoizedState = Object.assign({}, prevState, partialState)
  workInProgress.memoizedState = memoizedState
}