What is the difference if any between exporting an es6 default class inline with its definition versus at the end of the file after its definition?
Following are two examples I came across in React tutorials.
Ex. 1: Inline with Class
export default class App extends React.Component {
// class definition omitted
}
Ex. 2: End of file
class App extends React.Component [
// class definition omitted
}
export default App; // is this different somehow?
If there is no difference, then it seems the first example is more efficient and concise.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…