Flow error with react render method
Asked Answered
F

1

7

I ran into the error below while trying to add some flow type checking to one of my test apps.

I don't really understand what it means nor how to fix it.

render(): ?React.Element {

error:

Element: 
Application of polymorphic type needs <list of 1 argument>. (Can use `*` for inferrable ones)

Let me know if you need more code (maybe class definition etc).

Faulkner answered 28/6, 2016 at 14:15 Comment(0)
N
13

It seems now we should to write Element<any> insted just Element

Nonconformity answered 29/6, 2016 at 13:31 Comment(2)
Flow Docs and github.com/facebook/react-native/blob/…Nonconformity
I wonder why React is using <any> instead of <Object>. My understanding of Flow's doc suggests this would be better: flow.org/en/docs/types/anyFactorize

© 2022 - 2024 — McMap. All rights reserved.