It might be helpful to look at how functions and variables are exported, so that you can see how they are imported.
I will explain further, but here are the docs:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export
To export the default
variable/function from a file you would use the export default
phrase.
var testObj = { 'hello' : 'world' };
export default testObj;
To import the default
variable/function from a file you would do it like so:
import testObj from './testFile';
To export a standard variable/function from a file you would use the standard export
keyword.
var testObj = { 'hello' : 'world' };
var testObj2 = { 'hello' : 'again' };
export { testObj, testObj2 };
// or if you just want to export testObj - notice the default keyword is missing
export testObj;
To import a standard variable/function from a file you must wrap the imported variable/function inside braces.
TL;DR;
Only the default exported variable/function from a file can be imported without braces, anything else must be imported from within braces. Input
is not the default export from mdbreact
which is why it must be imported like so:
import { Input } from 'mdbreact';
*
will import all available exports from the file, which is why that allowed your import to work. but you don't want to import all components from mdbreact
on every file use mdbreact
in or your project would become bloated very quickly.