ReactDOMFiber-test Rename portal -> usePortal (#8535)
Fixes lint since I used portal as a variable name. We typically use a verb for functions.
Sebastian Markbåge committed
Dec 8, 2016 at 14:22 UTC
14f05bfa891dda978a2952be288bb9225f41da47
1 file changed
+16
-16
src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
+16
-16
@@ -194,7 +194,7 @@ describe('ReactDOMFiber', () => {
194
var expectHTML = {ref: el => htmlEls.push(el)};
195
var expectMath = {ref: el => mathEls.push(el)};
196
197
- var portal = function(tree) {
197
+ var usePortal = function(tree) {
198
return ReactDOM.unstable_createPortal(
199
tree,
200
document.createElement('div')
@@ -371,7 +371,7 @@ describe('ReactDOMFiber', () => {
371
assertNamespacesMatch(
372
<svg {...expectSVG}>
373
<image {...expectSVG} />
374
- {portal(
374
+ {usePortal(
375
<div {...expectHTML} />
376
)}
377
<image {...expectSVG} />
@@ -380,7 +380,7 @@ describe('ReactDOMFiber', () => {
380
assertNamespacesMatch(
381
<math {...expectMath}>
382
<mi {...expectMath} />
383
- {portal(
383
+ {usePortal(
384
<div {...expectHTML} />
385
)}
386
<mi {...expectMath} />
@@ -389,7 +389,7 @@ describe('ReactDOMFiber', () => {
389
assertNamespacesMatch(
390
<div {...expectHTML}>
391
<p {...expectHTML} />
392
- {portal(
392
+ {usePortal(
393
<svg {...expectSVG}>
394
<image {...expectSVG} />
395
</svg>
@@ -404,7 +404,7 @@ describe('ReactDOMFiber', () => {
404
<div {...expectHTML}>
405
<math {...expectMath}>
406
<mi {...expectMath} />
407
- {portal(
407
+ {usePortal(
408
<svg {...expectSVG}>
409
<image {...expectSVG} />
410
</svg>
@@ -416,7 +416,7 @@ describe('ReactDOMFiber', () => {
416
assertNamespacesMatch(
417
<math {...expectMath}>
418
<mi {...expectMath} />
419
- {portal(
419
+ {usePortal(
420
<svg {...expectSVG}>
421
<image {...expectSVG} />
422
<foreignObject {...expectSVG}>
@@ -434,9 +434,9 @@ describe('ReactDOMFiber', () => {
434
);
435
assertNamespacesMatch(
436
<div {...expectHTML}>
437
- {portal(
437
+ {usePortal(
438
<svg {...expectSVG}>
439
- {portal(
439
+ {usePortal(
440
<div {...expectHTML} />
441
)}
442
<image {...expectSVG} />
@@ -448,7 +448,7 @@ describe('ReactDOMFiber', () => {
448
assertNamespacesMatch(
449
<svg {...expectSVG}>
450
<svg {...expectSVG}>
451
- {portal(
451
+ {usePortal(
452
<div {...expectHTML} />
453
)}
454
<image {...expectSVG} />
@@ -461,7 +461,7 @@ describe('ReactDOMFiber', () => {
461
it('should keep track of namespace across portals (complex)', () => {
462
assertNamespacesMatch(
463
<div {...expectHTML}>
464
- {portal(
464
+ {usePortal(
465
<svg {...expectSVG}>
466
<image {...expectSVG} />
467
</svg>
@@ -484,7 +484,7 @@ describe('ReactDOMFiber', () => {
484
<svg {...expectSVG}>
485
<svg {...expectSVG}>
486
<image {...expectSVG} />
487
- {portal(
487
+ {usePortal(
488
<svg {...expectSVG}>
489
<image {...expectSVG} />
490
<svg {...expectSVG}>
@@ -496,7 +496,7 @@ describe('ReactDOMFiber', () => {
496
<image {...expectSVG} />
497
<foreignObject {...expectSVG}>
498
<p {...expectHTML} />
499
- {portal(<p {...expectHTML} />)}
499
+ {usePortal(<p {...expectHTML} />)}
500
<p {...expectHTML} />
501
</foreignObject>
502
</svg>
@@ -510,7 +510,7 @@ describe('ReactDOMFiber', () => {
510
<svg {...expectSVG}>
511
<foreignObject {...expectSVG}>
512
<p {...expectHTML} />
513
- {portal(
513
+ {usePortal(
514
<svg {...expectSVG}>
515
<image {...expectSVG} />
516
<svg {...expectSVG}>
@@ -518,7 +518,7 @@ describe('ReactDOMFiber', () => {
518
<foreignObject {...expectSVG}>
519
<p {...expectHTML} />
520
</foreignObject>
521
- {portal(<p {...expectHTML} />)}
521
+ {usePortal(<p {...expectHTML} />)}
522
</svg>
523
<image {...expectSVG} />
524
</svg>
@@ -605,7 +605,7 @@ describe('ReactDOMFiber', () => {
605
assertNamespacesMatch(
606
<svg {...expectSVG}>
607
<ErrorBoundary>
608
- {portal(
608
+ {usePortal(
609
<div {...expectHTML}>
610
<math {...expectMath}>
611
<BrokenRender />)
@@ -617,7 +617,7 @@ describe('ReactDOMFiber', () => {
617
/*
618
* TODO: enable. Currently this leads to stack overflow
619
* but it might be a bug in error boundaries rather than SVG or portals.
620
- portal(
620
+ usePortal(
621
<div {...expectHTML} />
622
)
623
*/