Component best practice question.

vanskins

Van Alfred P. Sabacajan

Posted on February 7, 2024

Component best practice question.

Hi everyone on my current job right now as a front end developer, my lead developer ask me to create a skeleton fallback components integrating the Skeleton component from MUI.

On every fallback component I created I always imported Skeleton component from MUI. But my lead told me to create a dumb component which encapsulates the Skeleton component and pass the same props as the Skeleton component from MUI and instead of using the Skeleton component from MUI I should use the dumb component I created.

So basically I just created a copy of the Skeleton component from MUI.

Are there any benefit of doing it?

Sample code

import { Skeleton } from "mui/material"

export const OurSkeletonComponent = (props) => <Skeleton {{...props}} />

💖 💪 🙅 🚩
vanskins
Van Alfred P. Sabacajan

Posted on February 7, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Component best practice question.
react Component best practice question.

February 7, 2024