So coming from an Angular/AngularJS background, you have states, and each state is a separate page. E.g. in a social network you can have a state with your feed, a state with a
Another solution. Files index.js and product.js are in the directory src\pages. For more information watch video https://www.youtube.com/watch?v=hjR-ZveXBpQ.
file App.js
import React from "react";
import {
BrowserRouter as Router,
Route,
Switch
} from "react-router-dom";
import Products from "./pages"
import Product from "./pages/product"
const App = () => {
return (
);
}
export default App;
file index.js
import React from "react";
import {Link} from "react-router-dom";
const Products = () => {
return (
Products
Go to product
);
};
export default Products;
file product.js
import React from "react";
const Product = () => {
return (
Product !!!!!!
);
}
export default Product;