Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
I want to convert the functional code below to class component instead. How can I do that?

I have the functional component below and want to convert it to class component could someone please help me out with that? I want it to be something like this.

class CalendarCreateModal extends React.PureComponent {
  constructor(props) {
    super(props);
    this.state = {.....

Right now it looks like this, below code.

const ModalData = [
  { name: "Reminders", src: CalendarCreate2, action: "Reminders" },
  { name: "Events", src: CalendarCreate3, action: "Events" },
  { name: "Programs", src: CalendarCreate4, action: "Programs" }
];


const CalendarCreateModal = ({ onClose, history, openRemindersModal }) => {
  const [openModal, setOpenModal] = useState("");

  const onSubmitClick = event => {
    if (openModal === "Events") {
      history.push("/partners/events/list");
    }
    if (openModal === "Programs") {
      history.push("/partners/programs/list");
    }
    if (openModal === "Reminders") {
      openRemindersModal(true);
      onClose();
    }
  };

  return (
    ........
  )
}
export default CalendarCreateModal;
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!