Skip to content

Instantly share code, notes, and snippets.

View list.jsx
const list = [
<UpdateList key={ '0' }/>,
<UpdateList key={ '1' }/>,
<UpdateList key={ '2' }/>,
]
ReactDOM.render( list, document.getElementById( '..' ) );
View userAgent.jsx
let userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/ 604.1.21 (KHTML, like Gecko) Version/ 12.0 Mobile/17A6278a Safari/602.1.26';
if (Platform.OS !== 'ios') {
userAgent = 'Mozilla/5.0 (Linux; Android 8.0.0; TA-1053 Build/OPR1.170623.026) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3368.0 Mobile Safari/537.36';
}
return (
<SafeAreaView>
<WebView
...
userAgent={userAgent}
...
View setState.js
this.setState({value: 'changed!'}, () => console.log(this.state) );
View NoSPA.js
class CustomDocument extends Document {
render() {
return (
<html>
<Head>
</Head>
<body>
<nav className="navbar navbar-expand navbar-light bg-light">
...
View .babelrc
{
"presets": [ "@babel/react" ],
"plugins": [
["@babel/plugin-proposal-decorators", {"legacy": true}],
["@babel/plugin-proposal-class-properties", {"loose": true}]
]
}
View View.js
import store from './store';
@observer
class View extends Component {
render() {
return <div>{ store.userName }</div>
}
}
export default View;
View Store.js
class Store {
@observer userName = '';
}
export default new Store();
View update-password-settings.sql
-- 암호 검증에 대한 플러그인을 제거합니다.
uninstall plugin validate_password;
-- 설정 업데이트
ALTER USER 'root'@'localhost'
IDENTIFIED WITH mysql_native_password
BY ''; -- homebrew로 설치시 기본 비밀번호는 '' 입니다. 본인의 설정에 맞게 변경하세요.
View my.cnf
default-authentication-plugin=mysql_native_password