Skip to content

Commit

Permalink
Update export style
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Sep 23, 2019
1 parent 3debcd4 commit 51325d8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
4 changes: 1 addition & 3 deletions website/modules/examples/Ambiguous.js
@@ -1,7 +1,7 @@
import React from "react";
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";

function AmbiguousExample() {
export default function AmbiguousExample() {
return (
<Router>
<div>
Expand Down Expand Up @@ -58,5 +58,3 @@ function User({ match }) {
</div>
);
}

export default AmbiguousExample;
4 changes: 1 addition & 3 deletions website/modules/examples/RouteConfig.js
Expand Up @@ -76,7 +76,7 @@ function RouteWithSubRoutes(route) {
);
}

function RouteConfigExample() {
export default function RouteConfigExample() {
return (
<Router>
<div>
Expand All @@ -96,5 +96,3 @@ function RouteConfigExample() {
</Router>
);
}

export default RouteConfigExample;
4 changes: 1 addition & 3 deletions website/modules/examples/Sidebar.js
Expand Up @@ -24,7 +24,7 @@ const routes = [
}
];

function SidebarExample() {
export default function SidebarExample() {
return (
<Router>
<div style={{ display: "flex" }}>
Expand Down Expand Up @@ -80,5 +80,3 @@ function SidebarExample() {
</Router>
);
}

export default SidebarExample;
10 changes: 4 additions & 6 deletions website/modules/examples/StaticRouter.js
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { StaticRouter, Route } from "react-router-dom";
import { StaticRouter as Router, Route } from "react-router-dom";

// This example renders a route within a StaticRouter and populates its
// staticContext, which it then prints out. In the real world you would
Expand Down Expand Up @@ -44,24 +44,22 @@ function PrintContext(props) {
return <p>Static context: {JSON.stringify(props.staticContext)}</p>;
}

class StaticRouterExample extends Component {
export default class StaticRouterExample extends Component {
// This is the context object that we pass to the StaticRouter.
// It can be modified by routes to provide additional information
// for the server-side render
staticContext = {};

render() {
return (
<StaticRouter location="/foo" context={this.staticContext}>
<Router location="/foo" context={this.staticContext}>
<div>
<RouteStatus statusCode={404}>
<p>Route with statusCode 404</p>
<PrintContext staticContext={this.staticContext} />
</RouteStatus>
</div>
</StaticRouter>
</Router>
);
}
}

export default StaticRouterExample;

0 comments on commit 51325d8

Please sign in to comment.