A simple accordion made out of react hooks.
npm install react-hooks-accordion
yarn add react-hooks-accordion
>= react@16.8.1
>= react-dom@16.8.1
import React from "react";
import { render } from "react-dom";
import Accordion from "react-hooks-accordion";
render(
<Accordion
className="accordion"
title="Accordion Title"
onToggle={visible => {
alert(`Accordion is ${visible}`);
}}
>
<ul>
<li>
<span>Hello</span>
</li>
<li>
<span>How are you</span>
</li>
<li>
<span>I am good</span>
</li>
</ul>
</Accordion>,
document.getElementById("root")
);
Type: function
Argument: boolean
npm start
npm run build