我编写了一个组件,将其作为输入签入和签出并显示它们。我在Safari Safari 13上遇到问题,当新签入,签出道具从父级到达时,组件不会重新呈现。我尝试打印某些内容,但这些值是从父级到达的,但该组件未重新渲染。您是否知道iOS sasfari有类似问题?谢谢你!
const CalendarRecap = ({ checkin, checkout }) => {
return (
<div className="calendar-recap">
<div className="__dates">
<div className="__box __checkin-box">
<div className="__title"> Checkin</div>
<div
className={cx("__field __checkin", {
"--unsetted": !checkin,
})}
>
{checkin}
</div>
</div>
<div className="__box __checkout-box">
<div className="__title"> Checkout</div>
<div
className={cx("__field __checkout", {
"--unsetted": !checkout,
})}
>
{checkout}
</div>
</div>
</div>
<button className="__confirm" type="button">
confirm
</button>
</div>
);
};
export default CalendarRecap;
CalendarRecap.propTypes = {
checkin: PropTypes.string.isRequired,
checkout: PropTypes.string.isRequired
};```