Hướng dẫn ReactJS ReactJS tutorial (p3) Bài 3: ReactJS Tìm hiểu các Components trong React

6 154 5
Hướng dẫn ReactJS   ReactJS tutorial (p3)  Bài 3: ReactJS  Tìm hiểu các Components trong React

Đang tải... (xem toàn văn)

Thông tin tài liệu

Bài 3: ReactJS Tìm hiểu các Components trong React Trong bài này chúng ta sẽ tìm hiểu về các components trong React và cách quản lý chúng. STATELESS EXAMPLE Chúng ta tiếp tục sử dụng lại App.js, thêm vào 2 components đó là Header và Content, App sẽ chứa 2 component mới thêm vào, sau đó ta export thằng App. App.js

... Setup import React from 'react' ; import ReactDOM from 'react- dom'; import App from './App.jsx'; ReactDOM.render(, document.getElementById('app')); Và kết ta được: STATEFULL EXAMPLE Trong ví... TableRow nhận giá trị state component cha App (Chúng ta tìm hiểu kĩ state props sau) App.js import React from 'react' ; class App extends React. Component { constructor() { super(); this.state =... elements sau Index.js ta giữ nguyên code, import React from 'react' ; import ReactDOM from 'react- dom'; import App from './App.jsx'; ReactDOM.render(, document.getElementById('app')); Kết

Ngày đăng: 03/04/2018, 17:19

Từ khóa liên quan

Mục lục

  • Bài 3: ReactJS - Tìm hiểu các Components trong React

    • STATELESS EXAMPLE

    • App.js

    • export default App; 

    • STATEFULL EXAMPLE

    • App.js

Tài liệu cùng người dùng

Tài liệu liên quan