mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-11 10:59:55 +08:00
Added tests for 'children' set to both elements and functions to elements in 'react-router'.
This commit is contained in:
22
types/react-router/test/Children.tsx
Normal file
22
types/react-router/test/Children.tsx
Normal 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>
|
||||
}
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user