From 27b91dabcf50bf52fb433967d9602cc2ecce2ba6 Mon Sep 17 00:00:00 2001 From: YUUU23 Date: Tue, 9 Jul 2024 11:16:09 -0500 Subject: [PATCH] refactor: use props delegation instead of simply props --- docs/assets/CenteredImage.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/assets/CenteredImage.jsx b/docs/assets/CenteredImage.jsx index 4f12cbe4..0a0feeab 100644 --- a/docs/assets/CenteredImage.jsx +++ b/docs/assets/CenteredImage.jsx @@ -9,17 +9,17 @@ import React from "react"; * imgStyle: object, any image styles (props can be passed in as: `imgStyle={{ maxHeight: "600px", border: "solid" }}`) * @returns a component for uniformally centering images in the doc */ -export default function CenteredImage(props) { +export default function CenteredImage({ src, alt, imgStyle }) { let imgStyleString; - if (props.imgStyle != undefined && Object.keys(props.imgStyle).length === 0) { + if (imgStyle != undefined && Object.keys(imgStyle).length === 0) { imgStyleString = {}; } else { - imgStyleString = props.imgStyle; + imgStyleString = imgStyle; } return (
- {props.alt} + {alt}
); }