install react application

   2 npm -v

   3 npm uninstall -g create-react-app

   4 npm cache clean --force

   5 npm init react-app my-react-app


cd my-react-app

npm start



how to view



React Directly in HTML

The quickest way start learning React is to write React directly in your HTML files.

on ist initial 



app.js

it will look like thsi 

import logo from './logo.svg';
import './App.css';

function App() {
  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <p>
          Edit <code>src/App.js</code> and save to reload.
        </p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
      </header>
    </div>
  );
}

export default App;

modify the app.js

import './App.css';

function App() {
  return (
    <div className="App">
      <h1>Hello World!</h1>
    </div>
  );
}

export default App;



=

No comments:

Post a Comment

How to host application on server new way

 copy the htacess from public to root copy the server.php from public to root but rename to index.php htacess <IfModule mod_rewrite.c>...