const Post = () => { const [isLoading, setIsLoading] = useState(false); /* render post, etc */ }
const Text = styled.span` font-size: 16px; color: red; `
class HomeScreen extends React.Component { static navigationOptions = { title: 'Home', }; /* render function, etc */ }
Define navigation configuration
const Post = ({ post }) => ( <div> <span>{post.title}</span> <span>{post.description}</span> </div>);const PostFragmentContainer = createFragmentContainer( Post, { post: graphql` fragment Post_post on Post { id title description }, `,});
Define which data your component needs
useEffect(() => { i18n.changeLanguage(lang); }, [lang]);