import { Component, ErrorInfo, ReactNode } from 'react';                                                                                                                                                                                                                                                                  
 22                                                                                                                                                                                                                                                                                                                           
 21 type StateType = {                                                                                                                                                                                                                                                                                                        
 20 │ hasError: boolean;                                                                                                                                                                                                                                                                                                      
 19 };                                                                                                                                                                                                                                                                                                                        
 18                                                                                                                                                                                                                                                                                                                           
 17 class ErrorBoundary extends Component {                                                                                                                                                                                                                                                                                   
 16 │ state = { hasError: false };                                                                                                                                                                                                                                                                                            
 15 │                                                                                                                                                                                                                                                                                                                         
 14 │ static getDerivedStateFromError(): StateType {                                                                                                                                                                                                                                                                          
 13 │ │ return { hasError: true };                                                                                                                                                                                                                                                                                            
 12 │ }                                                                                                                                                                                                                                                                                                                       
 11 │                                                                                                                                                                                                                                                                                                                         
 10 │ componentDidCatch(error: Error, info: ErrorInfo): void {                                                                                                                                                                                                                                                                
  9 │ │ /* eslint no-console: "off" */                                                                                                                                                                                                                                                                                        
  8 │ │ console.error('ErrorBoundary', error, info);                                                                                                                                                                                                                                                                          
  7 │ }                                                                                                                                                                                                                                                                                                                       
  6 │                                                                                                                                                                                                                                                                                                                         
  5 │ render(): ReactNode {                                                                                                                                                                                                                                                                                                   
  4 │ │ // @ts-expect-error @TODO fix types                                                                                                                                                                                                                                                                                   
  3 │ │ return this.state.hasError ? null : this.props.children;                                                                                                                                                                                                                                                              
  2 │ }                                                                                                                                                                                                                                                                                                                       
  1 }                                                                                                                                                                                                                                                                                                                         
24  export default ErrorBoundary;             

how to fix render() function. if i remove TODO i got this error:

                                                                                                                                                                                                                                                                                                                       
▁   1 │ render(): ReactNode {                                                                                                                                                                                                                                                                                                 
E 20  │ │ return this.state.hasError ? null : this.props.children;     ■ Property 'children' does not exist on type 'Readonly<{}>'.                                                                                                                                                                                           
    1 │ }