mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
docs: update React example in ES6 properly
This commit is contained in:
parent
6b56bb10bb
commit
ce1274d436
@ -427,13 +427,13 @@ module.exports = Breadcrumbs;
|
|||||||
// ES6的写法
|
// ES6的写法
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const Breadcrumbs = React.createClass({
|
class Breadcrumbs extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
return <nav />;
|
return <nav />;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
export default Breadcrumbs
|
export default Breadcrumbs;
|
||||||
```
|
```
|
||||||
|
|
||||||
如果模块只有一个输出值,就使用`export default`,如果模块有多个输出值,就不使用`export default`,`export default`与普通的`export`不要同时使用。
|
如果模块只有一个输出值,就使用`export default`,如果模块有多个输出值,就不使用`export default`,`export default`与普通的`export`不要同时使用。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user