React Js / UI / Modal
Modal
-
1. Step
Step 1: Install Bootstrap
npm install react-bootstrap bootstrap Step 2: Create a Bootstrap Modal using React
src/components/MyModal.tsx
import React, { useState } from 'react'; import 'bootstrap/dist/css/bootstrap.min.css'; import { Modal, Button } from 'react-bootstrap'; function MyModal() { const [show, setShow] = useState(false); const handleShow = () => setShow(true); const handleClose = () => setShow(false); return ( ); } export default MyModal;React Bootstrap Modal This is the modal content. Step 3: Use the Component in App
import React from "react"; import MyModal from './components/MyModal'; class Header extends React.Component { render() { return Header
; } } class Footer extends React.Component { render() { returnFooter
; } } class App extends React.Component { render() { return (); } } export default App;This is the main content.
MANVIA BLOG