Skip to content

Commit 287a1df

Browse files
committed
Add story for failing SVG example
1 parent 1647e85 commit 287a1df

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

stories/index.stories.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
});

0 commit comments

Comments
 (0)