File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,16 @@ export const useCreateComponent = <T extends ConnectElementTagName>(
14
14
> ( null ) ;
15
15
const { connectInstance} = useConnectComponents ( ) ;
16
16
const wrapperDivRef = React . useRef < HTMLDivElement | null > ( null ) ;
17
- const wrapper = < div ref = { wrapperDivRef } > </ div > ;
17
+
18
+ // We set width to 100% to preserve this functionality aspect of embedded components even though
19
+ // we are introducing a wrapper div for this element
20
+ // https://docs.corp.stripe.com/connect/get-started-connect-embedded-components#width-and-height
21
+ const wrapper = < div style = { { width : '100%' } } ref = { wrapperDivRef } > </ div > ;
18
22
19
23
React . useLayoutEffect ( ( ) => {
20
24
if ( wrapperDivRef . current !== null && component === null ) {
21
25
const newComponent = connectInstance . create ( tagName ) ;
26
+
22
27
setComponent ( newComponent ) ;
23
28
if ( newComponent !== null ) {
24
29
try {
You can’t perform that action at this time.
0 commit comments