React Faceoff at Philly.NET

9

Click here to load reader

Transcript of React Faceoff at Philly.NET

Page 1: React Faceoff at Philly.NET

React

Chris Gomez

@SpaceShot

www.chrisgomez.com

[email protected]

http://mixer.com/SpaceShot-

Page 2: React Faceoff at Philly.NET

Chris Gomez

• Proud attendee of Philly.NET since 2008

• First software was in BASIC on DOS 2.1

•Wrote a Press Your Luck clone (with Whammies) in Turbo Pascal

•Microsoft MVP in Visual Studio Tools and Development Technologies

• Contributor to the Static Void Podcastwww.staticvoidpodcast.com

Page 3: React Faceoff at Philly.NET

Agenda

• React

• Start Coding in React

• Keep Coding in React

• Finish Coding in React

Page 4: React Faceoff at Philly.NET

Getting Started

•Using codesandbox.io in the browser

•This sets up a React environment for you

•https://codesandbox.io/s/ykjqropr5z

•Create basic index.html

•Create basic index.js

•Webpack is binding this (hidden magic)

Page 5: React Faceoff at Philly.NET

React basics

•React, ReactDOM packages

•React.createElement creates DOM

•ReactDOM.render assigns a DOM element to render components to.

Page 6: React Faceoff at Philly.NET

React basics

•React, ReactDOM packages

•React.createElement creates DOM

•ReactDOM.render assigns a DOM element to render components to.

•Wow that does not look fun.

Page 7: React Faceoff at Philly.NET

Enter JSX

•Syntax extension to JavaScript

•Browsers won’t understand

•Need a transpiler (typically Babel)

•Modern toolchains set this up for you.

Page 8: React Faceoff at Philly.NET

React Components

•“class” based with JavaScript classes

• function based

•These can hold state, too

•Arrow functions as stateless components

Page 9: React Faceoff at Philly.NET

Learning Resources

Kent Dodds

A Beginner’s Guide to ReactJS

https://egghead.io/courses/the-beginner-s-guide-to-reactjs