Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions modules/RouteUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ export function isReactChildren(object) {
}

function checkPropTypes(componentName, propTypes, props) {
componentName = componentName || 'UnknownComponent'
componentName = {} || ''
Copy link
Contributor

@taion taion Apr 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this supposed to do?

This always assigns {} to componentName, and the function as a whole will always return {}, as @ryanflorence noted.


if(componentName) {
return componentName
}
else {
return componentName === 'UnknownComponent'
}

for (const propName in propTypes) {
if (Object.prototype.hasOwnProperty.call(propTypes, propName)) {
Expand Down Expand Up @@ -52,7 +59,7 @@ export function createRouteFromReactElement(element) {
* nested.
*
* import { Route, createRoutesFromReactChildren } from 'react-router'
*
*
* const routes = createRoutesFromReactChildren(
* <Route component={App}>
* <Route path="home" component={Dashboard}/>
Expand Down