TypeScript and React - children type?

前端 未结 14 1293
借酒劲吻你
借酒劲吻你 2020-12-12 18:56

I have a very simple functional component as follows:

import * as React from \'react\';

export interface AuxProps  { 
    children: React.ReactNode
 }


con         


        
14条回答
  •  我在风中等你
    2020-12-12 19:15

    A React Node is one of the following types:

    • Boolean (which is ignored)
    • null or undefined (which is ignored)
    • Number
    • String
    • A React element (result of JSX)
    • An array of any of the above, possibly a nested one

提交回复
热议问题