React children is possible null in TypeScript

后端 未结 0 1034
悲哀的现实
悲哀的现实 2021-01-26 16:53

I have the next component:

const Step: React.FC = ({ children }) => {
  console.log(children.length) // TS2533: Object is possibly \'null\' or \'undefined\'.
          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题