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
17 changes: 15 additions & 2 deletions modules/RouteUtils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import warning from './routerWarning'


function isValidChild(object) {
return object == null || React.isValidElement(object)
}
Expand All @@ -10,7 +11,19 @@ export function isReactChildren(object) {
}

function checkPropTypes(componentName, propTypes, props) {
componentName = componentName || 'UnknownComponent'

componentName = {} || ''
Copy link
Member

@ryanflorence ryanflorence Apr 15, 2016

Choose a reason for hiding this comment

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

this will always be {}, obliterating the arg coming in. What's the goal with this PR?


<<<<<<< HEAD
if(componentName) {
=======
if(componentName !== null || undefined && typeof componentName === 'object') {
>>>>>>> origin/master
return componentName
}
else {
return componentName === 'UnknownComponent'
}

for (const propName in propTypes) {
if (Object.prototype.hasOwnProperty.call(propTypes, propName)) {
Expand Down Expand Up @@ -52,7 +65,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