Skip to content

Instantly share code, notes, and snippets.

@mikecann
Last active February 11, 2016 03:34
Show Gist options
  • Save mikecann/22ee6e0f333dc4b772b2 to your computer and use it in GitHub Desktop.
Save mikecann/22ee6e0f333dc4b772b2 to your computer and use it in GitHub Desktop.
import { MarkdSiteRoot } from "../../MarkdSiteRoot";
import { Signup } from "../../signup/Signup";
import { Homepage } from "../../homepage/Homepage";
import { Router, Route, Link, IndexRoute, browserHistory } from 'react-router';
import * as React from "react";
import * as ReactDOM from "react-dom";
import { FirebaseUsersService } from "../services/UsersService";
import { AggregateLogger, ConsoleLogger } from "../helpers/logging/Logging";
var logger = new AggregateLogger();
logger.loggers.push(new ConsoleLogger());
const firebaseRoot = "xxxx;
var userService = new FirebaseUsersService(firebaseRoot, logger);
/*
I want to pass some custom props to the Signup component, as far as I undersand it, I have
to wrap the thing to do this in a typesafe way..
*/
class SignupWrapper extends React.Component<{}, {}> {
render() {
return <Signup logger={logger} usersService={userService} />
}
}
export const routes = <Router history={browserHistory}>
<Route path="/" component={MarkdSiteRoot}>
{/* this results in blank screen */}
<Route path="signup" component={SignupWrapper} />
{/* this works
<Route path="signup" component={Signup} />
*/}
<IndexRoute component={Homepage} />
</Route>
</Router>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment