Method 1:
const BasicProfileInfo = (props: BasicProfileInfoProps) => {
return (
<MainContainer>
{....}
</MainContainer>
)
}
Method 2:
function BasicProfileInfo(props: BasicProfileInfoProps){
return (
<MainContainer>
{....}
</MainContainer>
)
}
Project Environment:
- babel-eslint: 8.0.2
- babel-plugin-transform-class-properties: 6.24.1
- babel-preset-es2015: 6.24.1
- babel-preset-react-native: 4.0.0
- react: 16.0.0
- react-native: 0.48.4
- mobx: 3.3.1
- mobx-react: 4.3.3
this
in the function (which would be a strange choice to do in a stateless component), they're functionally equivalent. Use whichever one looks nicest to you. – Joe Clay