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
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3dd53-2b910.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3dd53-2b910.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?