Intro - made this originally for my friend trying to do C++ homework on a Mac.
- Add this Dockerfile
FROM alpine
RUN apk add --update make
RUN apk add build-base
RUN mkdir /mycode
| const SomeComponent = p => <div>{p.message}</div>; |
| interface SomeProps { | |
| message: string; | |
| } | |
| const SomeComponent: React.SFC<SomeProps> = p => <div>{p.message}</div>; |
| type SFC<P = {}> = StatelessComponent<P>; | |
| interface StatelessComponent<P = {}> { | |
| (props: P & { children?: ReactNode }, context?: any): ReactElement<any> | null; | |
| propTypes?: ValidationMap<P>; | |
| contextTypes?: ValidationMap<any>; | |
| defaultProps?: Partial<P>; | |
| displayName?: string; | |
| } |
Intro - made this originally for my friend trying to do C++ homework on a Mac.
FROM alpine
RUN apk add --update make
RUN apk add build-base
RUN mkdir /mycode
| // thanks to @jnelson for showing me this technique | |
| const original = () => process.env.someThing; | |
| // you might be tempted to do this | |
| const original2 = () => { | |
| console.log(process.env.someThing); | |
| return process.env.someThing; | |
| }; |
adb logcat allows tailing of Native logs in React Native (Android)adb shell ls <dir> or any adb shell commandexp start -a --tunnel./gradlew <command> (build)./gradlew assembleRelease)| // https://github.com/acdlite/recompose/wiki/Recipes | |
| // Container.js | |
| import { compose, lifecycle, setStatic } from 'recompose'; | |
| import { retrieveStuff } from '../../services/db/index'; | |
| import SavedStuff from './SavedStuff'; | |
| import { generateNavOptions } from '../../nav'; | |
| const withStoryData = lifecycle({ | |
| state: { loading: true }, | |
| componentDidMount() { |
| /** | |
| * Reads the state tree managed by the store. | |
| * | |
| * @returns {any} The current state tree of your application. | |
| */ | |
| function getState() { | |
| if (isDispatching) { | |
| throw new Error( | |
| 'You may not call store.getState() while the reducer is executing. ' + | |
| 'The reducer has already received the state as an argument. ' + |
| let currentReducer = reducer | |
| let currentState = preloadedState | |
| let currentListeners = [] | |
| let nextListeners = currentListeners | |
| let isDispatching = false | |
| function ensureCanMutateNextListeners() {...} | |
| function getState() {...} |