JavaScript

ReactJS

Creating new application /w Create React App

> npm install -g create-react-app
> create-react-app my-app

> cd my-app
> npm start
> npm run build (packages for production)
> npm test

https://facebook.github.io/react/docs/installation.html#creating-a-new-application

Sublime

Column highlighting – Left click + Option (then select)

Text highlighting
Command + Shift + P
Install (for PackageControll:InstallPackage)
Then type the name of the package

Split screen
Option + Command + 2 (drag files)

Hacks

This is away to check that a object is not null before asking for it’s property.

const goLiveGasDay = gasDay && moment(gasDay);

When converting between class and method
* props -> this.props
* translate -> this.context.translate

Difference between a method on it’s own and a method in a function

    const getDefaultSortOrder = () => {
        return {
            properties: ['Id'],
            directions: ['asc'],
        };
    };
    
    getDefaultSortOrder() {
        return {
            properties: ['Id'],
            directions: ['asc'],
        };
    }
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: