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, {useReducer} from 'react'; | |
import {StyleSheet, Text, Button, View} from 'react-native'; | |
export default function App() { | |
let [state, dispatch] = useReducer(function (state, action) { | |
switch(action.type) { | |
case 'increment': return { count: state.count + 1 }; | |
case 'decrement': return { count: state.count - 1 }; | |
default: throw new Error(); | |
} |
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 merge = require('webpack-merge') | |
exports.onCreateWebpackConfig = ({ actions, getConfig }) => { | |
const originalWebpackConfig = getConfig() | |
const reactNativeWebConfig = { | |
resolve: { | |
extensions: [ | |
'.web.js', | |
'.js', |
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
AppRegistry.runApplication(appName, { | |
initialProps: {}, | |
rootTag: document.getElementById('root'), | |
}); |