Skip to content

Instantly share code, notes, and snippets.

View sainthkh's full-sized avatar
🏠
Finding remote job

Kukhyeon Heo sainthkh

🏠
Finding remote job
  • South Korea
View GitHub Profile
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();
}
@sainthkh
sainthkh / gatsby-node.js
Created May 22, 2019 01:11
Don't need gatsby-plugin-react-native-web. Just copy below to gatsby-node.js
const merge = require('webpack-merge')
exports.onCreateWebpackConfig = ({ actions, getConfig }) => {
const originalWebpackConfig = getConfig()
const reactNativeWebConfig = {
resolve: {
extensions: [
'.web.js',
'.js',
AppRegistry.runApplication(appName, {
initialProps: {},
rootTag: document.getElementById('root'),
});