Table of Contents
Reactjs begins
Dev env
Webpack
Project structure
-
- why I always went the other way?
Beginner Tutorial
Good tutorial
Boilerplate
1. Tips and Tricks
- Canvas object detection
- Disable cors checking: https://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome
- Master/detail view pagination
- Layout & routing
Events passing
- Approaches: https://stackoverflow.com/a/31563614
Compose
compose merge functions:
const hoc1 = ...; const hoc2 = ...; const enhance = compose(hoc1, hoc2); const Component = enhance(BaseComponent);
The same thing can be done with the following.
const Component = hoc1(hoc2(BaseComponent));
implementation of compose is quite simple.
const compose = funcs => funcs.reduce((p, c) => (...args) => p(c(...args))); // this only works if funcs.length >= 2