my-common-form
v5.1.2
Published
To test login React components
Downloads
12
Readme
Quickstart
Install the module with:
npm install my-common-form
Depedency Required
npm install react-router-dom --save
npm install --save-dev express cors
Getting Started
Import Login to your React Page Component
import {Login} from 'my-common-form'
How to use
and then in your app.js file import component-
import {Login} from 'my-common-form'
import { BrowserRouter, Route, Routes } from 'react-router-dom';
function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/login" element={<Login loginUrl={'<API URL>'} redirectTo={'< After login redirect to page path>'}>
</Login> } />
</Routes>
</BrowserRouter>
);
}
Example
import {Login} from 'my-common-form'
import { BrowserRouter, Route, Routes } from 'react-router-dom';
function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/login" element={<Login loginUrl={'http://localhost:8080/login'} redirectTo={'/home'}>
</Login> } />
</Routes>
</BrowserRouter>
);
}