Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}), routes.map(function (route, i) {
if (route.redirect) {
return _react.default.createElement(_reactRouterDom.Redirect, {
key: route.key || i,
from: route.path,
to: route.redirect,
exact: route.exact,
strict: route.strict
});
}
var RouteRoute = route.Routes ? withRoutes(route) : RouteWithProps;
return _react.default.createElement(RouteRoute, {
key: route.key || i,
path: route.path,
exact: route.exact,
strict: route.strict,
sensitive: route.sensitive,
keepAlive: route.keepAlive,
"use strict";
var React = require('react');
var createReactClass = require('create-react-class');
var ReactRouter = require('react-router-dom');
var AuthorForm = require('./authorForm');
var AuthorActions = require('../../actions/authorActions');
var AuthorStore = require('../../stores/authorStore');
var Redirect = ReactRouter.Redirect;
var Prompt = ReactRouter.Prompt;
var ManageAuthorPage = createReactClass({
getInitialState: function() {
return {
author: { id: '', firstName: '', lastName: '' },
errors: {},
dirty: false,
redirect: false
};
},
componentDidMount: function() {
var authorId = this.props.match.params.id; //from the path '/author:id'
if (authorId) {
this.setState({author: AuthorStore.getAuthorById(authorId) });
}((function () { 'use strict';
var _nornj = require("nornj");
var _reactRouterDom = require("react-router-dom");
(0, _nornj.registerComponent)({
BrowserRouter: _reactRouterDom.BrowserRouter,
HashRouter: _reactRouterDom.HashRouter,
'router-Link': _reactRouterDom.Link,
MemoryRouter: _reactRouterDom.MemoryRouter,
'router-NavLink': _reactRouterDom.NavLink,
'router-Prompt': _reactRouterDom.Prompt,
Redirect: _reactRouterDom.Redirect,
Route: _reactRouterDom.Route,
Router: _reactRouterDom.Router,
StaticRouter: _reactRouterDom.StaticRouter,
'router-Switch': _reactRouterDom.Switch
});
})));