Skip to content

Commit bd6833a

Browse files
Add a data attribute to npm wrapper divs so we can identify them from connect-js internally (#157)
* Use inline instead of 100% div * Update src/useCreateComponent.tsx Signed-off-by: Michael Hines <michaelphines@stripe.com> * Update src/useCreateComponent.tsx Signed-off-by: Michael Hines <michaelphines@stripe.com> --------- Signed-off-by: Michael Hines <michaelphines@stripe.com>
1 parent d4da9ce commit bd6833a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useCreateComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const useCreateComponent = <T extends ConnectElementTagName>(
1818
// We set width to 100% to preserve this functionality aspect of embedded components even though
1919
// we are introducing a wrapper div for this element
2020
// https://docs.corp.stripe.com/connect/get-started-connect-embedded-components#width-and-height
21-
const wrapper = <div style={{width: '100%'}} ref={wrapperDivRef}></div>;
21+
const wrapper = <div style={{width: '100%'}} data-stripe-connect-js-wrapper ref={wrapperDivRef}></div>;
2222

2323
React.useLayoutEffect(() => {
2424
if (wrapperDivRef.current !== null && component === null) {

0 commit comments

Comments
 (0)