| Method | Side effects1 | State updates2 | Example uses |
|---|---|---|---|
| Mounting | |||
componentWillMount |
✓ | Constructor equivalent for createClass |
|
render |
Create and return element(s) | ||
componentDidMount |
✓ | ✓ | DOM manipulations, network requests, etc. |
| Updating | |||
componentWillReceiveProps |
✓ | Update state based on changed props |
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
| RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
| RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
| RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache | |
| npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache | |
| Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache |
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
| var mcapi = require('./node_modules/mailchimp-api/mailchimp'); | |
| var usersRef = db.ref('users'); | |
| var mc = new mcapi.Mailchimp('xxxxxxxxxx-api-key-us4'); | |
| usersRef.orderByChild('added_to_mailchimp').equalTo(null).on('child_added',function(snapshot){ | |
| var user = snapshot.val(); | |
| var key = snapshot.key; | |
| if(user && user.email){ | |
| var listId = 'xxxx-list-id-xxxx'; | |
| var name = user.displayName || ''; |
A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.
| Name | Stars | Last Commit | Description |
|---|---|---|---|
| three.js | ![GitHub |
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
| Locale Identifier | Description | |
|---|---|---|
| af | Afrikaans | |
| af-NA | Afrikaans (Namibia) | |
| af-ZA | Afrikaans (South Africa) | |
| agq | Aghem | |
| agq-CM | Aghem (Cameroon) | |
| ak | Akan | |
| ak-GH | Akan (Ghana) | |
| am | Amharic | |
| am-ET | Amharic (Ethiopia) |
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
| var functions = require('firebase-functions'); | |
| const sendgrid = require('sendgrid') | |
| const client = sendgrid("YOUR_SG_API_KEY") | |
| function parseBody(body) { | |
| var helper = sendgrid.mail; | |
| var fromEmail = new helper.Email(body.from); | |
| var toEmail = new helper.Email(body.to); | |
| var subject = body.subject; |
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
| // No Security | |
| { | |
| "rules": { | |
| ".read": true, | |
| ".write": true | |
| } | |
| } |
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
| import React, { Component } from 'react' | |
| import { RootNavigator } from './navigators' | |
| import { GoogleAnalyticsTracker } from './utils/analytics' | |
| import { GA_TRACKING_ID } from './constants' | |
| class App extends Component { | |
| // gets the current screen from navigation state | |
| getCurrentRouteName = (navigationState) => { | |
| if (!navigationState) { | |
| return null |