0.0.10 • Published 2 years ago

@fodieniakate/modalep14 v0.0.10

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Migration d'une application jQuery vers React

HTML5 CSS3 JavaScript React

Présentation

SNAPSHOT

Installing the package

1/ Install package :

npm i @fodieniakate/modalep14

2/ Import the component from the library :

import { Modale2 } from "@fodieniakate/modalep14";

3/ Place this state hook (concerning the opening/closing of the modal) at the start of the function that uses the Modal component :

const [isOpen, setIsOpen] = useState(false)

4/ In the return of the function, call the Modal component with at least the setIsOpen:

{isOpen && <Modal setIsOpen={setIsOpen} />}

5/ Example :

import React, { useState } from "react";
import { Modale2 } from "@fodieniakate/modalep14";

export default function Home() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <>
      <h1>Modal Test</h1>
      <button onClick={() => setIsOpen(true)}>Open Modal</button>
      {isOpen && <Modale2 setIsOpen={setIsOpen} />}
    </>
  );
}

Prérequis

npm

Node.js

Dépendances

react

react-dom

@babel/cli

@babel/core

@babel/plugin-syntax-jsx

@babel/preset-react

@fodieniakate/modalep14

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago