Giter Club home page Giter Club logo

react-todolist's Introduction

Take Care

React的三个方面

  1. React JS:用React的语法来编写网页的交互效果
  2. React Native:用React的语法来编写原生的app应用
  3. React VR:开发全景应用

初始化项目

  1. npm install create-react-app -g全局安装react脚手架工具
  2. create-react-app todolist创建react安装目录,cd todolist进入项目目录文件夹,npm run start启动项目,浏览器访问localhost:3000即可进行访问

JSX与JS

JSX即JavaScript XML,一种在react组件内部构造标签的类XML语法

  1. JSX
class TodoList extends React.Component {
  render() {
    return (
      <h1 className="title">Hello World</h1>
    );
  }
  1. JS
class TodoList extends React.Component {
  render() {
    return (
      React.createElement(
        'h1',
        {className: 'title'},
        'Hello World'
      )
    );
  }

JSX实际上是一种React.createElement的简单实现

Fragment

Fragment替换无意义的外部标签,渲染的时候会消失

import React,{Fragment} from 'react';
return (
  <Fragment>
  {/* 最后根节点会消失 */}
  </Fragment>
)

keep studying...

react-todolist's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.