From 2a676103ba55ea2e66527d29de0b9ca88ce02ab2 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Tue, 5 Feb 2019 21:41:31 +0000 Subject: [PATCH] Top-level docstring for app.js --- app/src/frontend/app.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/src/frontend/app.js b/app/src/frontend/app.js index c0b4a0f3..842aed6f 100644 --- a/app/src/frontend/app.js +++ b/app/src/frontend/app.js @@ -16,7 +16,18 @@ import SignUp from './signup'; import Welcome from './welcome'; - +/** + * App component + * + * This is the top-level stateful frontend component + * - rendered from props, instantiated either server-side in server.js or client-side in + * client.js + * - state (including user, current building) is initialised from props + * - callbacks to update top-level state are passed down to subcomponents + * - render method wraps a react-router switch - this drives which version of the sidebar and + * map or other pages are rendered, based on the URL. Use a react-router-dom in + * child components to navigate without a full page reload. + */ class App extends React.Component { constructor(props) { super(props); @@ -159,6 +170,10 @@ class App extends React.Component { ); } } + +/** + * Component to fall back on in case of 404 or no other match + */ const NotFound = () => (