Giter VIP home page Giter VIP logo

es6-for-react's Introduction

Introduction

Why I wrote this?

Facebook has just released the v15.5.0 of React.

In this new version, some main functions (e.g. createClass) are deprecated.

React supported ES6 syntax since v0.14.*, and Facebook recommends us to use new ES6 syntax to write React App.

But most of us are still stay in the "jQuery Age", we hate new syntax, we hate JSX, and we don't want to change.

Actually, many new syntaxes ES6 standard offer us are quite useful. Especially keywords like class import and etc. truly enhanced the capabilities of JavaScript. Syntactic sugar like arrow function could save lots of our time.

But at the same time, ES6 JavaScript is much more like a totally different language for newbies. We have to change lots of traditions as well as learn many new keywords we haven't seen.

So, it's very necessary for us to learn ES6 JavaScript before we learn React.

Of course, many of us don't have that much time to go through the whole standard document of ES6. So, I gathered the most important parts of ES6 that we often apply in React, reorganized those key points for saving learners' time.

Why using ES6+ syntaxes

If you refuse to use ES6 & JSX features, you probabbly have to write React code like this:

var createReactClass = require('create-react-class');

var Greeting = createReactClass({
  render: function() {
    return React.createElement('div', null, 'Hello ' + this.props.name);
  }
});

But when using arrow function and JSX you are able to refactor above codes in one line:

const Greeting = props => <div>Hello {props.name}</div>

Who should read this?

Newbie who want to learn the newest version of React, but have no idea what ES6 is.

The learner who want to change, learn new things and taste the super power of ES6.

Packages version

Softwares we use

es6-for-react's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vitorgil hhy5277

es6-for-react's Issues

Someone abused the credentials in your .git/config file

A person going by the name gitsbackup has overwritten your commits.
You can easily recover them by pushing from the cloned repository which was used for this attack. Make sure to delete the credentials in the .git/config file then and change your password.

Use git push -u origin master -f && git push --tags -f from your local clone to push all references for master, tags and so on to the remote and then enable 2FA in your account.

See my full answer at https://security.stackexchange.com/a/209473/6090

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.