export default in react code example
Example 1: export default react
import React from 'react';
class HelloWorld extends React.Component {
render() {
return <p>Hello, world!</p>;
}
}
export default HelloWorld;
Example 2: export default function react
export default () => (
<pre>Header</pre>
)
Example 3: export default class react
import Template from './components/templates'
Example 4: export default class react
export default class Template {}
Example 5: export default class react
class Template {}
class AnotherTemplate {}
export { Template, AnotherTemplate }