typescript报错:类型“ReactNode”的参数不能赋给类型“ReactElement<any, string | JSXElementConstructor<any>>”的参数,如何解决?
最近在做antd项目,使用typescript写layout组件,通过cloneElement给子组件的props添加initialState中的数据遇到飘红:类型“ReactNode”的参数不能赋给类型“ReactElement>”的参数。这里涉及到下面两个知识点:ReactNode这是一种联合类型,可以是string、number、ReactElement、{}、boolean、ReactNo