You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React Native lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components.
It depends on what project you are going to build. As for front-end developer, you nearly need to learn nothing, only a new way to write javascript (Redux, JSX).
When we are developing our app, there are some features we always need to add, e.g. ListView components only refresh when the data in listItem is changed, initializing data before render function but not in the constructor function…
React Native component has already been implemented with many native optimization for us, but those features above are not. To do that, we need to override lifecycle function in React Native component.
The order of lifecycle should be:
constructor() -> componentWillMount() -> render() -> componentDidMount() -> [ runtime loop ] -> componentWillUnmount()
Because the principle of the Redux state, the state always is read-only. And if we want to update some variable, we always have to return a new value.
The problem is javascript always pass object by reference, and redux store could not recognize Array element 's data changes because Array reference is not changed.
The right way to update
For example, let's assume we have an array in our state name "events" and contains many event objects.
E.g. the right way to update:
function updateEvnet(state, ID, data ) {
let events = [...state.events];
for (let index = 0; index < events.length; ++index) {
Created
April 8, 2018 16:22— forked from blixt/prng.js
A very simple, seedable JavaScript PRNG.
This file contains hidden or 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
Normally a color matrix is a 5x5 matrix. Here are 5x5 color matrix as a example:
Brightness Matrix Contrast Matrix
R G B A W R G B A W
R [1 0 0 0 b] R [c 0 0 0 t]
G [0 1 0 0 b] G [0 c 0 0 t]
B [0 0 1 0 b] B [0 0 c 0 t]
A [0 0 0 1 0] A [0 0 0 1 0]