componentDidUpdate -> triggered by forceUpdate or all everything update on props & state ( React.Component )
render -> triggered by componentDidUpdate ( note : not render if setState on purecomponent.componentDidMount() )
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
| python -m virtualenv py3 -p python3.7 |
from InstagramAPI import InstagramAPI as IG
from pprint import PrettyPrinter
from getpass import getpass
from random import randint
import time
pp = PrettyPrinter(indent=2)
api = IG(# example error
# scenario :
$ yarn test (on react) # or
$ jest --watch
2016-09-22 10:49 node[79167] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
# solution
# install watchman
# latitude pattern regex
^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,6})?))$
# longitude pattern regex
^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,6})?))$
Problem: Unsuccessful deployment javascript application when update package.json
- yarn
- docker
# Example error Message
Step 4/8 : RUN yarn install
---> Running in hashnumber
yarn install v1.6.0
[1/4] Resolving packages...
[2/4] Fetching packages...
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, {Fragment} from 'react'; | |
| import { | |
| BrowserRouter as Router, | |
| Route, | |
| Link | |
| } from "react-router-dom"; | |
| import {Admin, User} from './Auth'; // Add this line | |
| const Navigation = () => ( |
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'; | |
| /** | |
| * Get User from Local Storage | |
| * https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API | |
| * @return {obeject} UserData | |
| * { | |
| * username: string, | |
| * role: string | |
| * } | |
| */ |
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 logo from './logo.svg'; | |
| //import './App.css'; | |
| import Routers from './Router'; | |
| class App extends Component { | |
| render() { | |
| return <Routers/>; | |
| } | |
| } |