Page 2 of 3

react CSS

Posted: 2018 May 25, 15:43
by ejsoon

render之前的map䋸環

Posted: 2018 May 29, 15:40
by ejsoon
const listItems = numbers.map((number) =>
<li>{number}</li>
);

支持事件與阻止事件

Posted: 2018 May 30, 09:56
by ejsoon
支持事件

event.preventDefault();

Using Axios with React

Posted: 2018 May 31, 11:53
by ejsoon

react動畫

Posted: 2018 May 31, 14:16
by ejsoon

這句用在name也是變量的情況

Posted: 2018 May 31, 14:45
by ejsoon
this.setState({
[name]: value
});

Re: 哈哈哈學react路由(本貼爲新版本)

Posted: 2018 May 31, 17:51
by ejsoon
ejsoon wrote:
2018 May 24, 10:33
react-router-dom

研究近一週,稍懂:

Code: Select all

// index.js
ReactDOM.render(
		 <Router>
			<div>
				<Home />
				<Switch>
					<Route path="/rend" component={Rend}/>
					<Route path="/repay" component={Repay}/>
					<Route path="/me" component={Me}/>
				</Switch>
			</div>
		 </Router>
	, document.getElementById('root'));

// Home.js
class Home extends Component {
  render() {
    return (
      <div className="Home">
				{this.props.children}
        <div className="btnav">
					<div className="btnavchild">
						<NavLink activeClassName="selected" to="/rend">
						借款
						</NavLink>
					</div>
					<div className="btnavchild">
						<NavLink activeClassName="selected" to="/repay">
						还款
						</NavLink>
					</div>
					<div className="btnavchild">
						<NavLink activeClassName="selected" to="/me">
						我的
						</NavLink>
					</div>
        </div>
      </div>
    );
  }
}

組件中的子路由直接上Route,不要再套Router了。坑啊!

react改端口

Posted: 2018 Jun 04, 10:18
by ejsoon
package.json:`
"start": "set PORT=3036 && react-scripts start",

中文文檔

Posted: 2018 Jun 20, 16:40
by ejsoon

Learn React & Webpack by building the Hacker News front page

Posted: 2018 Jun 20, 18:39
by ejsoon