Use modules in naming conventions example

Following the rule from further up: "Always use modules (import/export) over a non-standard module system."
This commit is contained in:
Matias Singers
2015-04-12 20:44:48 +08:00
committed by Josh Perez
parent 0cca5e21fc
commit e5006931f1

View File

@@ -1704,17 +1704,17 @@
class CheckBox {
// ...
}
module.exports = CheckBox;
export default CheckBox;
// in some other file
// bad
const CheckBox = require('./checkBox');
import CheckBox from './checkBox';
// bad
const CheckBox = require('./check_box');
import CheckBox from './check_box';
// good
const CheckBox = require('./CheckBox');
import CheckBox from './CheckBox';
```
- Use camelCase when you export-default a function. Your filename should be identical to your function's name.