Skip to content

Commit 14f05bf

Browse files
authored
ReactDOMFiber-test Rename portal -> usePortal (facebook#8535)
Fixes lint since I used portal as a variable name. We typically use a verb for functions.
1 parent 6c785ed commit 14f05bf

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ describe('ReactDOMFiber', () => {
194194
var expectHTML = {ref: el => htmlEls.push(el)};
195195
var expectMath = {ref: el => mathEls.push(el)};
196196

197-
var portal = function(tree) {
197+
var usePortal = function(tree) {
198198
return ReactDOM.unstable_createPortal(
199199
tree,
200200
document.createElement('div')
@@ -371,7 +371,7 @@ describe('ReactDOMFiber', () => {
371371
assertNamespacesMatch(
372372
<svg {...expectSVG}>
373373
<image {...expectSVG} />
374-
{portal(
374+
{usePortal(
375375
<div {...expectHTML} />
376376
)}
377377
<image {...expectSVG} />
@@ -380,7 +380,7 @@ describe('ReactDOMFiber', () => {
380380
assertNamespacesMatch(
381381
<math {...expectMath}>
382382
<mi {...expectMath} />
383-
{portal(
383+
{usePortal(
384384
<div {...expectHTML} />
385385
)}
386386
<mi {...expectMath} />
@@ -389,7 +389,7 @@ describe('ReactDOMFiber', () => {
389389
assertNamespacesMatch(
390390
<div {...expectHTML}>
391391
<p {...expectHTML} />
392-
{portal(
392+
{usePortal(
393393
<svg {...expectSVG}>
394394
<image {...expectSVG} />
395395
</svg>
@@ -404,7 +404,7 @@ describe('ReactDOMFiber', () => {
404404
<div {...expectHTML}>
405405
<math {...expectMath}>
406406
<mi {...expectMath} />
407-
{portal(
407+
{usePortal(
408408
<svg {...expectSVG}>
409409
<image {...expectSVG} />
410410
</svg>
@@ -416,7 +416,7 @@ describe('ReactDOMFiber', () => {
416416
assertNamespacesMatch(
417417
<math {...expectMath}>
418418
<mi {...expectMath} />
419-
{portal(
419+
{usePortal(
420420
<svg {...expectSVG}>
421421
<image {...expectSVG} />
422422
<foreignObject {...expectSVG}>
@@ -434,9 +434,9 @@ describe('ReactDOMFiber', () => {
434434
);
435435
assertNamespacesMatch(
436436
<div {...expectHTML}>
437-
{portal(
437+
{usePortal(
438438
<svg {...expectSVG}>
439-
{portal(
439+
{usePortal(
440440
<div {...expectHTML} />
441441
)}
442442
<image {...expectSVG} />
@@ -448,7 +448,7 @@ describe('ReactDOMFiber', () => {
448448
assertNamespacesMatch(
449449
<svg {...expectSVG}>
450450
<svg {...expectSVG}>
451-
{portal(
451+
{usePortal(
452452
<div {...expectHTML} />
453453
)}
454454
<image {...expectSVG} />
@@ -461,7 +461,7 @@ describe('ReactDOMFiber', () => {
461461
it('should keep track of namespace across portals (complex)', () => {
462462
assertNamespacesMatch(
463463
<div {...expectHTML}>
464-
{portal(
464+
{usePortal(
465465
<svg {...expectSVG}>
466466
<image {...expectSVG} />
467467
</svg>
@@ -484,7 +484,7 @@ describe('ReactDOMFiber', () => {
484484
<svg {...expectSVG}>
485485
<svg {...expectSVG}>
486486
<image {...expectSVG} />
487-
{portal(
487+
{usePortal(
488488
<svg {...expectSVG}>
489489
<image {...expectSVG} />
490490
<svg {...expectSVG}>
@@ -496,7 +496,7 @@ describe('ReactDOMFiber', () => {
496496
<image {...expectSVG} />
497497
<foreignObject {...expectSVG}>
498498
<p {...expectHTML} />
499-
{portal(<p {...expectHTML} />)}
499+
{usePortal(<p {...expectHTML} />)}
500500
<p {...expectHTML} />
501501
</foreignObject>
502502
</svg>
@@ -510,15 +510,15 @@ describe('ReactDOMFiber', () => {
510510
<svg {...expectSVG}>
511511
<foreignObject {...expectSVG}>
512512
<p {...expectHTML} />
513-
{portal(
513+
{usePortal(
514514
<svg {...expectSVG}>
515515
<image {...expectSVG} />
516516
<svg {...expectSVG}>
517517
<image {...expectSVG} />
518518
<foreignObject {...expectSVG}>
519519
<p {...expectHTML} />
520520
</foreignObject>
521-
{portal(<p {...expectHTML} />)}
521+
{usePortal(<p {...expectHTML} />)}
522522
</svg>
523523
<image {...expectSVG} />
524524
</svg>
@@ -605,7 +605,7 @@ describe('ReactDOMFiber', () => {
605605
assertNamespacesMatch(
606606
<svg {...expectSVG}>
607607
<ErrorBoundary>
608-
{portal(
608+
{usePortal(
609609
<div {...expectHTML}>
610610
<math {...expectMath}>
611611
<BrokenRender />)
@@ -617,7 +617,7 @@ describe('ReactDOMFiber', () => {
617617
/*
618618
* TODO: enable. Currently this leads to stack overflow
619619
* but it might be a bug in error boundaries rather than SVG or portals.
620-
portal(
620+
usePortal(
621621
<div {...expectHTML} />
622622
)
623623
*/

0 commit comments

Comments
 (0)