Comments (3)
Are you using CommonJS or es6 imports? Can you share a link to the source code, or any other details?
from gulp-documentation.
@tmcw I'm using ES6 imports.
Here's a snippet of the source code:
import {connect} from 'react-redux'
import {fetchConfig} from 'state/config'
import Config from 'components/ecosystems/config'
import React, {PropTypes} from 'react'
import TitleBar from 'components/molecules/title-bar'
import NotFound from 'components/organisms/not-found'
import SiteFooter from 'components/atoms/site-footer'
import './global.sass'
/**
* The Layout component is the top-level component of the app.
*/
export class Layout extends React.Component {
static propTypes = {
config: PropTypes.shape({
existing: PropTypes.bool,
error: PropTypes.object,
loading: PropTypes.bool.isRequired,
serverSettings: PropTypes.shape({
hostName: PropTypes.string,
userName: PropTypes.string,
password: PropTypes.string,
version: PropTypes.string,
}),
}),
development: PropTypes.bool,
dispatch: PropTypes.func,
fetchConfig: PropTypes.func,
router: PropTypes.shape({
url: PropTypes.string,
route: PropTypes.shape({
name: PropTypes.string,
options: PropTypes.object,
}),
}),
};
componentDidMount() {
this.props.fetchConfig()
}
/**
* Only include DevTools if in development.
* @returns {React.Component}
*/
renderDevTools() {
if (this.props.development) {
const DevTools = require('utils/dev-tools')
return <DevTools/>
}
return null
}
/**
* Return the main content selected by the current route.
* @returns {React.Component}
*/
renderMainContent() {
const {config} = this.props
if (!config.existing) {
return <Config isFetching={config.loading}/>
}
switch (this.props.router.route.name) {
case 'config':
return <Config/>
default:
return <NotFound path={this.props.router.url}/>
}
}
render() {
const {config, router} = this.props
const existingConfig = config.existing && !config.loading
return (
<div>
<TitleBar currentRoute={router.route.name} showNav={existingConfig}/>
{this.renderMainContent()}
<SiteFooter version={config.serverSettings.version}/>
{this.renderDevTools()}
</div>
)
}
}
export default connect(
state => ({
router: state.router,
config: state.config.toJS(),
}), {fetchConfig}
)(Layout)
from gulp-documentation.
I am having the same issue with CommonJS requires.
from gulp-documentation.
Related Issues (20)
- How might one go about configuring a project to automatically set the title? HOT 3
- The code generator has deoptimised the styling of "..." as it exceeds the max of "100KB" HOT 2
- Allow usage of custom instance of documentation.js HOT 1
- TypeError: Cannot read property 'forEach' of undefined HOT 17
- Ignores description
- Please add License file HOT 1
- how do i run for all my files? HOT 6
- Name inference repeatedly documents the same items HOT 8
- ES6 babel project: Cannot read property 'reduce' or 'forEach' of undefined HOT 2
- `polyglot` gives me a blank documentation HOT 6
- Pass config and theme options HOT 1
- An in-range update of vinyl is breaking the build 🚨 HOT 1
- An in-range update of lint-staged is breaking the build 🚨 HOT 14
- Project name and version not included in HTML output HOT 2
- An in-range update of husky is breaking the build 🚨
- An in-range update of standard-version is breaking the build 🚨 HOT 2
- An in-range update of prettier is breaking the build 🚨 HOT 24
- An in-range update of concat-stream is breaking the build 🚨 HOT 1
- Version 10 of node.js has been released
- options do not seem to be working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-documentation.