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
| { | |
| "development": { | |
| "username": "root", | |
| "password": "password", | |
| "database": "database_development", | |
| "host": "127.0.0.1", | |
| "dialect": "mysql", | |
| "operatorsAliases": false | |
| }, | |
| "test": { |
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
| { | |
| "development": { | |
| "username": "root", | |
| "password": null, | |
| "database": "database_development", | |
| "host": "127.0.0.1", | |
| "dialect": "mysql", | |
| "operatorsAliases": false | |
| }, | |
| "test": { |
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
| 'use strict'; | |
| module.exports = { | |
| up: (queryInterface, Sequelize) => { | |
| /* | |
| Add altering commands here. | |
| Return a promise to correctly handle asynchronicity. | |
| Example: | |
| return queryInterface.createTable('users', { id: Sequelize.INTEGER }); | |
| */ | |
| }, |
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
| module.exports = { | |
| // eslint-disable-next-line no-unused-vars | |
| up: (queryInterface, Sequelize) => { | |
| return queryInterface.removeColumn('users', 'username'); | |
| }, | |
| down: (queryInterface, Sequelize) => { | |
| return queryInterface.addColumn('users', 'username', { | |
| allowNull: true, | |
| type: Sequelize.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 * as React from 'react'; | |
| const { useState } = React; | |
| export const UseStateSample = () => { | |
| const [count, setCount] = useState(0); | |
| return ( | |
| <p> | |
| <button onClick={() => setCount(count - 1)}>-</button> | |
| <b>{count}</b> |
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 * as React from 'react'; | |
| const { useState } = React; | |
| export const UseStateSample = () => { | |
| const [count, setCount] = useState(0); | |
| return ( | |
| <p> | |
| <button onClick={() => setCount(count - 1)}>-</button> | |
| <b>{count}</b> |
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
| export class ContohUseState extends React.Component { | |
| state = { count: 0 }; | |
| render() { | |
| const { count } = this.state; | |
| return ( | |
| <p> | |
| <button onClick={() => this.setState({ count: count - 1 })}>-</button> | |
| <b>{count}</b> | |
| <button onClick={() => this.setState({ count: count + 1 })}>+</button> | |
| </p> |
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 * as React from 'react'; | |
| const { useState } = React; | |
| export const ContohUseState = () => { | |
| const [count, setCount] = useState(0); | |
| return ( | |
| <p> | |
| <button onClick={() => setCount(count - 1)}>-</button> | |
| <b>{count}</b> |
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
| <button onClick={() => setCount(count + 1)}>+</button> |
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
| const initialState = { | |
| password: '', | |
| confirmPassword: '' | |
| }; | |
| const ResetPasswordPage = () => { | |
| const [form, setForm] = useState(initialState); | |
| const [errorMessage, setErrorMessage] = useState(initialState); | |
| const onFormChange = (fieldName, value) => { |
OlderNewer