In react life cycle methods like
componentDidUpdate(prevState,prevProps)
doesn't gives error.
like if its a function it should give error like reference error.
What i understand in setState we pass prevState inside a callback function which internally assigns prevState object like in high order function but in case of componentDidUpdate i don't get this how this works under the hood.