For example, my React APP depends on MUI package.
But I only import the Slider and AutoComplete from the package.
Will only these 2 components have an effect on my APP in terms of performance to the end user? Or does the entire package have the same effect regardless just because it is a dependency?
Webpack (shipped with create-react-app) makes sure that imports like that are transformed in production to minimise bundle size.
However, this is not the case in development. Without custom babel config, you will import the entire library and your app will take forever to start in development mode. The Mui docs has a section on how to deal with that, but it's a little outdated wrt/ create-react-app. Nowadays craco exists that makes this whole process a lot easier. But if you can't be bothered to learn yet another CRA anti-eject library, you can follow Mui's tutorial and get the exact same result, just less future-proof.