react_acordion8.js

Home   »   react_acordion8.js

import React, { useState } from 'react';

const Accordion = ({ title, content }) => {
  const [isActive, setIsActive] = useState(false);

  return (
 
setIsActive(!isActive)}>
{title}
{isActive ? '-' : '+'}
{isActive &&
{content}
}
); }; export default Accordion;

Leave a Reply

Your email address will not be published. Required fields are marked *