This file contains 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
Medium test gist |
This file contains 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 React, { Component } from 'react'; | |
import { Text, View, StyleSheet, Button, Alert } from 'react-native'; | |
import { Constants, Google } from 'expo'; | |
export default class App extends Component { | |
_handleGoogleLogin = async () => { | |
try { | |
const result = await Expo.Google.logInAsync({ | |
androidClientId: 'AndroidClientID.apps.googleusercontent.com', | |
iosClientId: 'IosClientId.apps.googleusercontent.com', |
This file contains 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
const test = async _ => { | |
const promises = [getOne(), getTwo(), getThree()] | |
console.log(‘Now’) | |
const [one, two, three] = await Promise.all(promises) | |
console.log(one) | |
console.log(two) | |
console.log(three) | |
console.log(‘Done’) | |
} | |
test() |
This file contains 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 { Localization } from 'expo'; | |
import i18n from 'i18next'; | |
import { reactI18nextModule } from 'react-i18next'; | |
const resources = { | |
fr: { | |
foo: 'como telle fous', | |
bar: 'chatouiller {{someValue}}', | |
}, | |
en: { |
This file contains 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 React from 'react'; | |
import { withNamespaces } from 'react-i18next'; | |
function TranslatableView(props) { | |
const { t, tReady } = props; | |
// tReady is true if translations were loaded. | |
// Use wait option to not render before loaded | |
// or render placeholder yourself if not tReady=false | |
return ( |
This file contains 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 React from 'react'; | |
import Router from './Router' | |
import './App.css'; | |
import { BrowserRouter } from "react-router-dom"; | |
function App() { | |
return ( | |
<BrowserRouter> | |
<Router /> |
This file contains 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 React from 'react'; | |
import { Route, Switch } from "react-router-dom"; | |
import Home from './pages/Home'; | |
const About = () => <div>About</div>; | |
const Contact = (props) => <div>{`${props.extra}`}</div>; | |
const NotFound = () => <div>Not found page</div>; | |
const Router = () => { |
This file contains 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 React from 'react'; | |
import logo from '../logo.svg'; | |
import { Link } from 'react-router-dom' | |
function Home() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<p> |
This file contains 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 React from 'react'; | |
import { | |
BrowserRouter, | |
Route, | |
Switch, | |
Redirect | |
} from 'react-router-dom'; | |
import decode from 'jwt-decode'; | |
import Home from './Home'; |
This file contains 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 React from 'react'; | |
import './App.css'; | |
import { Provider } from 'react-redux' | |
import store from './store' | |
import Home from './pages/Home' | |
function App() { | |
return ( | |
<Provider store={store}> | |
<Home/> |