无法 return `<AmplifyContext.Provider />` 因为 属性 `client` 在 `React.Element` [1] 中缺失,但存在于 `Client` 中

Cannot return `<AmplifyContext.Provider />` because property `client` is missing in `React.Element` [1] but exists in `Client`

不能 return <AmplifyContext.Provider /> 因为 属性 clientReact.Element 1 中缺失,但在 Client[= 中存在20=]

如何修复错误?

Try Flow

解决方案的方向是键入 return 值并使用 React.ElementReact.ComponentType。我把解决方案的开头放在一起(打开 in flow try),尽管我发现仍然需要在 client 周围更好地打字