export default as from code example
Example 1: export and export default
export foo;
export default foo;
export = foo;
import {foo} from 'blah';
import foo from 'blah';
import * as foo from 'blah';
Example 2: export default react
import React from 'react';
class HelloWorld extends React.Component {
render() {
return <p>Hello, world!</p>;
}
}
export default HelloWorld;
Example 3: export default
export default function add(x, y) {
return x + y;
}
export default function(x, y) {
return x + y;
}
Example 4: javascript export default
export let name1, name2, …, nameN;
export let name1 = …, name2 = …, …, nameN;
export function functionName(){...}
export class ClassName {...}
export { name1, name2, …, nameN };
export { variable1 as name1, variable2 as name2, …, nameN };
export const { name1, name2: bar } = o;
export default expression;
export default function (…) { … }
export default function name1(…) { … }
export { name1 as default, … };
export * from …;
export * as name1 from …;
export { name1, name2, …, nameN } from …;
export { import1 as name1, import2 as name2, …, nameN } from …;
export { default } from …;