embed
embed copied to clipboard
fix(TU-9582): Fix memoComponent type in the react lib
Adding the correct type to memoComponent, fixes the issue with incorrect embed types.
TODO: Add screenshots with before/after.
Fixes: #643
Unit tests fail as they do not allow aria-label prop. Maybe it should be ariaLabel?
FAIL src/components/make-button-component.spec.tsx
● Test suite failed to run
src/components/make-button-component.spec.tsx:[20](https://github.com/Typeform/embed/actions/runs/8689377407/job/23826940192?pr=646#step:8:21):55 - error TS2322: Type '{ 'aria-label': string; 'data-custom': string; }' is not assignable to type 'Partial<Omit<HTMLButtonElement, "style"> & AdditionalAttributes>'.
Object literal may only specify known properties, and ''aria-label'' does not exist in type 'Partial<Omit<HTMLButtonElement, "style"> & AdditionalAttributes>'.
20 <Button id="form-id" foo="bar" buttonProps={{ 'aria-label': 'aria-value-btn', 'data-custom': 'value-custom' }}>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/components/make-button-component.tsx:9:3
9 buttonProps?: ButtonProps
~~~~~~~~~~~
The expected type comes from property 'buttonProps' which is declared here on type 'IntrinsicAttributes & Props & ButtonComponentBaseProps & RefAttributes<unknown>'
[BOT] Preview available with hash 85ebfdfd8718a543ed51c94b14a33fe8e7d0914e here.
:tada: This PR is included in version @typeform/embed-v4.10.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This PR is included in version @typeform/embed-react-v3.17.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: