File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,28 @@ storiesOf('Portals', module)
226226 < Parent />
227227 </ div > ;
228228 } )
229+ . add ( 'Works with SVGs' , ( ) => {
230+ const portalNode = portals . createPortalNode ( ) ;
231+
232+ // From https://github.com/httptoolkit/react-reverse-portal/issues/2
233+ return < div >
234+ < svg >
235+ < rect x = { 0 } y = { 0 } width = { 300 } height = { 50 } fill = "gray" > </ rect >
236+ < rect x = { 0 } y = { 50 } width = { 300 } height = { 50 } fill = "lightblue" > </ rect >
237+ < svg x = { 30 } y = { 10 } >
238+ < portals . InPortal node = { portalNode } >
239+ < text alignmentBaseline = "text-before-edge" fill = "red" >
240+ test
241+ </ text >
242+ </ portals . InPortal >
243+ </ svg >
244+ < svg x = { 30 } y = { 70 } >
245+ < portals . OutPortal node = { portalNode } />
246+ </ svg >
247+ </ svg >
248+ </ div >
249+
250+ } )
229251 . add ( 'Example from README' , ( ) => {
230252 const MyExpensiveComponent = ( ) => 'expensive!' ;
231253
@@ -287,4 +309,4 @@ storiesOf('Portals', module)
287309 }
288310
289311 return < MyComponent componentToShow = 'component-a' />
290- } ) ;
312+ } ) ;
You can’t perform that action at this time.
0 commit comments