How to set the default value for React list rendering?

to render a list. The parent component passes down a data. The
subcomponent is received, and the thumbnail field of data is used.
but there is a thumbnail field of data that is null. Makes it impossible to render.
can you assign it a default value?

ask for advice. Please know how to operate and give me some advice. Thank you.

Mar.17,2021

this requires the use of smart components, that is, class components. You can specify the initial value of props .

  • is written in the class
class Demo extends Component {
    static defaultProps {
        // props
    }
}
  • is written outside the class
class Demo extends Component {
   // something
}
Demo.defaultProps = {
 // default props
}
Menu