diff --git a/README.md b/README.md index a1be3d1..b581a96 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,15 @@ npm install @compositor/x0 ## Features +- Zero-config - Hot-loading development environment - Works with virtually any React component\* -- No convoluted APIs +- No confusing APIs - Renders static HTML - Renders JS bundles - Use any CSS-in-JS library -- Routing with [react-router][react-router] -- Async data fetching +- Support for routing with [react-router][react-router] +- Support for async data fetching \* Components cannot rely on bundler features like webpack loaders @@ -136,16 +137,27 @@ To render multiple pages and use routing, add a `routes` array to the `package.j x0 static src/App.js --out-dir site ``` - - [Made by Compositor](https://compositor.io/) | [MIT License](LICENSE.md) diff --git a/lib/Router.js b/lib/Router.js deleted file mode 100644 index 4dd9516..0000000 --- a/lib/Router.js +++ /dev/null @@ -1,24 +0,0 @@ -const React = require('react') -const { - BrowserRouter, - StaticRouter, - Route, - Link -} = require('react-router-dom') - -const UniversalRouter = typeof document !== 'undefined' ? BrowserRouter : StaticRouter - -const h = React.createElement - -const Router = props => h(UniversalRouter, props, - h('div', null, props.children) -) - - -Router.defaultProps = { - context: {} -} - -module.exports = Router -module.exports.Route = Route -module.exports.Link = Link diff --git a/lib/index.js b/lib/index.js index 596d334..31373ca 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,3 +1,2 @@ module.exports.dev = require('./dev') module.exports.static = require('./static') -module.exports.Router = require('./Router') diff --git a/package.json b/package.json index 6ec5ac7..3f487c5 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,6 @@ "ora": "^1.3.0", "pkg-up": "^2.0.0", "react": "^16.2.0", - "react-dom": "^16.2.0", - "react-router-dom": "^4.2.2", "read-pkg-up": "^2.0.0", "update-notifier": "^2.2.0", "webpack": "^3.10.0", @@ -47,6 +45,8 @@ "isomorphic-fetch": "^2.2.1", "nano-style": "^1.0.0-20", "nyc": "^11.2.1", + "react-dom": "^16.2.0", + "react-router-dom": "^4.2.2", "refunk": "^2.0.0-1", "styled-components": "^2.2.4", "styled-system": "^1.0.7"