Replace Legacy Root API's Callback Argument

InstructorMichael Chan

Share this video with your friends

Send Tweet

React's legacy root API (render) took a callback function. React called this function once the post-render. With new streaming capabilities scheduled for React 18, this feature becomes unpredictable. Replace it with a ref callback — or one of these other strategies.