Added tests for 'children' set to both elements and functions to elements in 'react-router'.

This commit is contained in:
Daniel Rosenwasser
2017-05-30 00:53:43 -07:00
parent 0e687488aa
commit 4e4890ccc8
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import * as React from 'react';
import { Route } from 'react-router';
function RouteWithFunctionChildrenAttribute() {
return <Route path="/" children={() => <div>Hello!</div>} />
}
function RouteWithFunctionJsxChildren() {
return <Route path="/">
{() => <div>Hello!</div>}
</Route>
}
function RouteWithElementChildrenAttribute() {
return <Route path="/" children={<div>Hello!</div>} />
}
function RouteWithElementJsxChildren() {
return <Route path="/">
{<div>Hello!</div>}
</Route>
}

View File

@@ -18,6 +18,7 @@
"test/Animation.tsx",
"test/Auth.tsx",
"test/Basic.tsx",
"test/Children.tsx",
"test/CustomLink.tsx",
"test/ModalGallery.tsx",
"test/NavigateWithContext.tsx",