'Is there a difference to importing specific functions/variables vs importing it entirely?

When importing functions in for example, ReactJS, I normally import only specific functions.

import { useEffect, useState, /* ETC... */ } from 'react';

But is there a difference to just importing the whole module?

import React from 'react';

Except for the fact that you'll need to do React.useState() instead of useState(), is there a difference in performance? Does it load faster etc. I know it probably reads the entire file in both cases but is anything else affected?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source