Skip to content

hackbuddyorg/typescript-react-javascriptla

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro to TypeScript & React

Hi! This is the companion code repository for the JavaScriptLA Intro to TypeScript & React talk.

See the slides here!

Setup

Run these somewhere on your computer to download this repository and install its requirements:

git clone https://github.com/JoshuaKGoldberg/typescript-react-javascriptla
cd typescript-react-javascriptla
npm i

You can then open the folder in your editor. For example, with VS Code:

code .

Running TypeScript Snippets

It's generally easiest to install TypeScript globally:

npm i -g typescript

We recommend you then run TypeScript in "watch" mode on individual code examples by providing it the -w flag and a path to the example. For example, to start TypeScript running on the first code example:

tsc -w snippets/1

Alternately, if you'd prefer not to install TypeScript globally, you can use it as an already-installed dependency of this repository with the npm run compile command:

npm run compile -- snippets/1 -w
# Alternately: yarn compile snippets/1 -w

Running the React Demo

This project was bootstrapped with Create React App.

npm run start

Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

Type Checking the React Demo

Running tsc or npm run compile on its own will check the src/ folder.

tsc -w
npm run compile -- -w
# Alternately: yarn compile -w

Use compile:strict instead to enable some stricter TypeScript compiler options... if you dare!

About

Demo code for our Intro to TypeScript + React talk! ✨

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 51.4%
  • HTML 17.7%
  • JavaScript 16.1%
  • CSS 14.8%