Created
June 28, 2019 16:05
-
-
Save FreddyPoly/ec03432184c459889b4951e8e9ed0087 to your computer and use it in GitHub Desktop.
[REACT NATIVE] Example component TypeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react" | |
import { View, Text } from "react-native" | |
export interface Props { | |
propsVar: any; | |
} | |
export interface State { | |
stateVar: any; | |
} | |
export class Asset extends React.Component<Props, State> { | |
constructor(props: Props) { | |
super(props); | |
this.state = { | |
stateVar: 'Variable du state', | |
} | |
} | |
render() { | |
return ( | |
<View> | |
<Text>State: { this.state.stateVar }</Text> | |
<Text>Props: { this.props.propsVar }</Text> | |
</View> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment