Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/useCreateComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ export const useCreateComponent = <T extends ConnectElementTagName>(
const {connectInstance} = useConnectComponents();
const wrapperDivRef = React.useRef<HTMLDivElement | null>(null);

// We set width to 100% to preserve this functionality aspect of embedded components even though
// we are introducing a wrapper div for this element
// https://docs.corp.stripe.com/connect/get-started-connect-embedded-components#width-and-height
const wrapper = <div style={{width: '100%'}} ref={wrapperDivRef}></div>;
// We would prefer to use display: contents, but it's not well-supported
const wrapper = <div style={{display: 'inline'}} ref={wrapperDivRef}></div>;

React.useLayoutEffect(() => {
if (wrapperDivRef.current !== null && component === null) {
Expand Down