fable-compiler / fable-react

Fable bindings and helpers for React and React Native
MIT License
275 stars 66 forks source link

Remove (text: string) arg from TextInput #22

Closed Zaid-Ajaj closed 7 years ago

Zaid-Ajaj commented 7 years ago

TextInput cannot have child elements and the text should set in the props rather than in the children. According to a user on gitter:

When I try to make use of TextInput, passing it an arbitrary string, I get "Raw text cannot be used outside of a tag. Not rendering string: "foo""

He confirmed that using this alternative works:

let textInput (props: ITextInputProperties list) : React.ReactElement  =
        R.from (RN.TextInput) (unbox props) []

Which is the same as

let textInput (props: ITextInputProperties list) : React.ReactElement  =
       createElement(RN.TextInput, props, [])
alfonsogarciacaro commented 7 years ago

Thanks!

Zaid-Ajaj commented 7 years ago

Np :smile: