File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 11# About this folder
2+
23This folder holds configuration files for different environments.
34You can use it to provide your app with different settings based on the
45current environment, e.g. to configure different API base urls depending on
56whether your setup runs in dev mode or is built for distribution.
67You can include the configuration into your code like this:
78
9+ ** ES2015 Modules**
10+
11+ ``` js
12+ import config from ' config' ;
13+ ```
14+
15+ ** Common JS**
16+
17+ Due to Babel6 we need to append ` .default ` .
18+
19+ ``` js
20+ let config = require (' config' ).default ;
21+ ```
22+
23+ ** Example**
24+
825``` javascript
9- let react = require (' react/addons' );
10- let config = require (' config' );
26+ import React from ' react' ;
27+ import config from ' config' ;
28+
1129class MyComponent extends React .Component {
12- constructor (props ) {
13- super (props);
30+ constructor (props , ctx ) {
31+ super (props, ctx );
1432 let currentAppEnv = config .appEnv ;
1533 }
1634}
You can’t perform that action at this time.
0 commit comments