Skip to content

Use inline instead of 100% div #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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