Answers for "hello world react"

0

reactjs hello world

reactjs hello world
===============================
npx create-react-app myapp
cd myapp
npm start
http://localhost:3000/
-----------------------------
* check version
node -v
npm -v
* npm upgrade
npm i -g npm-upgrade
Posted by: Guest on August-14-2021
0

React js tutorial

npx create-react-app my-app
cd my-app
cd src

# If you're using a Mac or Linux:
rm -f *

# Or, if you're on Windows:
del *

# Then, switch back to the project folder
cd ..
Posted by: Guest on December-21-2020
0

hello world react

Page HTML :
    <div id = "root"> </div>

Page JS BABEL:
  ReactDOM.render(<h1> Hello , world ! </h1> , document.getElementById('root') );
Posted by: Guest on October-17-2021
1

reactjs basic example

// -------// -------// -------
// index.js
// -------// -------// -------

const user = {
  name: "zidane",
  email: '[email protected]'
};

const element = <h1> {user.name} exist email: {user.email} </h1>;

const element2 = 
  <div  className="heading"> 
     <h1> {user.name}  </h1>
     <h1> {user.email} </h1>
  </div>;

var numbers = [1,2,3,4];
var doubleNumbers = numbers.map(function(num){
  return num * 2 + "; ";
})

var doubleNumberArrowFunction = numbers.map((num)  => num * 3 + "; ");

var element3 = 
  <div>
    Double numbers: {doubleNumberArrowFunction}
  </div>;

ReactDOM.render(
  element3,
  // <React.StrictMode>
  //   <App />
  // </React.StrictMode>,
  document.getElementById('root')
);

// -------// -------// -------
// ------- index.css ------
// -------// -------// -------
.heading {
  padding: 10px;
  color: white;
  background-color: green;
}
Posted by: Guest on October-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language