Skip to content

Commit fe36a36

Browse files
committed
remove any “DOM” stuff
1 parent 908e9d3 commit fe36a36

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

modules/StaticRouter.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ class StaticRouter extends React.Component {
8282
<MatchProvider>
8383
{typeof children === 'function' ? (
8484
children({ location, router: this.getChildContext().router })
85-
) : React.Children.count(children) > 1 ? (
86-
// TODO: get rid of all DOM stuff
87-
<div>{children}</div>
8885
) : (
8986
children
9087
)}

modules/__tests__/integration-test.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ describe('Ambiguous matches?', () => {
130130
const div = document.createElement('div')
131131
render(
132132
<Router location="/foo">
133-
<Match pattern="/foo" render={() => <div>static</div>}/>
134-
<Match pattern="/:name" render={() => <div>param</div>}/>
133+
<div>
134+
<Match pattern="/foo" render={() => <div>static</div>}/>
135+
<Match pattern="/:name" render={() => <div>param</div>}/>
136+
</div>
135137
</Router>,
136138
div)
137139
expect(div.innerHTML).toContain('static')
@@ -144,12 +146,14 @@ describe('Ambiguous matches?', () => {
144146
const pathname = '/non-static-param'
145147
render((
146148
<Router location={pathname}>
147-
<Match pattern="/:name" render={({ params }) => (
148-
<div>
149-
<Match pattern="/foo" render={() => <div>foo</div>}/>
150-
<Miss render={() => <div>{params.name}</div>}/>
151-
</div>
152-
)}/>
149+
<div>
150+
<Match pattern="/:name" render={({ params }) => (
151+
<div>
152+
<Match pattern="/foo" render={() => <div>foo</div>}/>
153+
<Miss render={() => <div>{params.name}</div>}/>
154+
</div>
155+
)}/>
156+
</div>
153157
</Router>
154158
), div)
155159
expect(div.innerHTML).toNotContain('foo')
@@ -161,8 +165,10 @@ describe('Ambiguous matches?', () => {
161165
const pathname = '/foo'
162166
render((
163167
<Router location={pathname}>
164-
<Match pattern="/foo" render={() => <div>match</div>}/>
165-
<Miss render={() => <div>miss</div>}/>
168+
<div>
169+
<Match pattern="/foo" render={() => <div>match</div>}/>
170+
<Miss render={() => <div>miss</div>}/>
171+
</div>
166172
</Router>
167173
), div)
168174
expect(div.innerHTML).toContain('match')
@@ -189,10 +195,10 @@ describe('clicking around', () => {
189195
<Router>
190196
<div>
191197
<Link id="one" to="/one">One</Link>
198+
<Match pattern="/one" render={() => (
199+
<h1>{TEXT1}</h1>
200+
)}/>
192201
</div>
193-
<Match pattern="/one" render={() => (
194-
<h1>{TEXT1}</h1>
195-
)}/>
196202
</Router>
197203
), div)
198204
expect(div.innerHTML).toNotContain(TEXT1)

0 commit comments

Comments
 (0)