0.1.0 • Published 2 years ago
modal-gl-component v0.1.0
GL-React-Modal
This component must work with a react project like Create React App.
Install component
In the project directory, you can run:
npm i modal-gl-component
or
yarn add test-modale-gl
How to use this component
First import Modal (import { Modal } from "modal-gl-component/dist/index")
In the component where you will use it, you must have :
- state (withe the React Hook useState)
- a close function
Add the module where you want to use it.
For example :
export default function AppTest () {
const [modal, setModal] = useState(false)
const closeModal = () => {
setModal(!modal)
}
return (
<Modal
state={modal}
close={closeModal}
>
)
}
Homepage: https://github.com/glajoux/Modal_LajouxGuillaume_17032022
0.1.0
2 years ago