Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Finding remote job

Kukhyeon Heo sainthkh

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