From 078a3284dce777d911098eadd1352bb7f332768f Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Thu, 19 Apr 2018 12:15:37 -0400 Subject: [PATCH] Update ReactBasics.md --- ReactBasics.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ReactBasics.md b/ReactBasics.md index 459866f..0e333f4 100755 --- a/ReactBasics.md +++ b/ReactBasics.md @@ -40,6 +40,8 @@ React is a front-end framework which is designed to make building a Single Page ## Create a basic component +### HTML + Let's set up the HTML ```HTML @@ -71,6 +73,8 @@ Let's talk about all those script tags - Babel is a transpiler that will translate ES6 code to ES5 - it also handles turning JSX into regular JS +### JS + - Let's create a component which is just an H1 tag - We'll insert it into the `main` tag of our html @@ -87,7 +91,7 @@ ReactDOM.render( - All other attributes should work normally - React mixes HTML with JavaScript (JSX) - Notice that the HTML does not have quotes or backticks around it - +use `python -m SimpleHTTPServer` to start a basic server ## Assign JSX to a variable JSX just renders into regular JavaScript, so we can assign it to variable: @@ -101,6 +105,8 @@ ReactDOM.render( ); ``` +use `python -m SimpleHTTPServer` to start a basic server for our code + ## Embed an expression into JSX We can create variables and insert them into our JSX: