%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/emergentqj/actioncivile/pre-auth/.8352c036a19b0051d0217d27d25e3f4a/static/js/common/components/Modal/components/
Upload File :
Create Path :
Current File : /home/emergentqj/actioncivile/pre-auth/.8352c036a19b0051d0217d27d25e3f4a/static/js/common/components/Modal/components/Body.js

import React, { useEffect, useRef } from "react";
import PropTypes from "prop-types";
import { StyledBody } from "../Modal.styles";

export function Body({ onHeightChange, ...props }) {
  const ref = useRef();

  useEffect(() => {
    onHeightChange(ref?.current?.scrollHeight);
  // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [ref?.current?.scrollHeight]);

  return (
    <StyledBody ref={ref} {...props}>
      {props.children}
    </StyledBody>
  );
}

Body.propTypes = {
  onHeightChange: PropTypes.func.isRequired,
  children: PropTypes.node.isRequired,
};

Zerion Mini Shell 1.0