import React from "react"; import PropTypes from "prop-types"; import { Editor } from "@tinymce/tinymce-react"; import { useRef } from "react"; import { useEffect } from "react"; const CreateAdThirdStep = ({ childRef }) => { const editorKeyResponsibilitiesRef = useRef(); const editorRequirementsRef = useRef(); const editorOfferRef = useRef(); useEffect(() => { childRef.current = alertUser; }, []); function alertUser() { return { keyResponsibilities: editorKeyResponsibilitiesRef.current.getContent(), requirements: editorRequirementsRef.current.getContent(), offer: editorOfferRef.current.getContent(), }; } return (
(editorKeyResponsibilitiesRef.current = editor) } style={{ height: "1rem !important" }} />
(editorRequirementsRef.current = editor)} style={{ height: "1rem !important" }} />
(editorOfferRef.current = editor)} style={{ height: "1rem !important" }} />
); }; CreateAdThirdStep.propTypes = { childRef: PropTypes.any, }; export default CreateAdThirdStep;