Skip to content

Commit

Permalink
Add warning in EuiPortal about inability to render immediately. (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal authored Mar 29, 2018
1 parent f6836c4 commit 13ca884
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/portal/portal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/**
* NOTE: We can't test this component because Enzyme doesn't support rendering
* into portals.
*
* NOTE: You **cannot** immediately return a EuiPortal from within the render method! This is
* because the portalNode doesn't exist until **after** it's mounted. In its current form, EuiPortal
* can only be used by components which are hidden or otherwise not rendered initially, like
* dropdowns and modals. If we want to support components wrapped in EuiPortal being visible
* immediately we can update EuiPortal to accept a DOM node as a prop, which should solve the problem.
*/

import { Component } from 'react';
Expand Down

0 comments on commit 13ca884

Please sign in to comment.