-
Notifications
You must be signed in to change notification settings - Fork 6
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
Automatic event types and targets #143
Conversation
There are some build error with this PR: lerna run build > @grucloud/[email protected] build /Users/fredericheem/bau/bau-ui/examples/bau-storybook
> tsc && vite build
src/pages/radioButtonGroup/radioButtonGroup-statefull.ts(29,26): error TS2345: Argument of type '{ oninput: ({ target }: { target: HTMLInputElement; }) => string; name: string; value: string; radios: { value: string; Label: () => string; }[]; }' is not assignable to parameter of type '({ name: string; value?: any; oninput?: ((event: any) => any) | undefined; radios: RadioItem[]; } & DefaultDesignProps & PropsAll<HTMLElement>) | undefined'.
Type '{ oninput: ({ target }: { target: HTMLInputElement; }) => string; name: string; value: string; radios: { value: string; Label: () => string; }[]; }' is not assignable to type 'undefined'.
src/pages/radioButtonGroup/radioButtonGroup-url.ts(40,26): error TS2345: Argument of type '{ oninput: ({ target }: { target: HTMLInputElement; }) => void; name: string; value: string | null; radios: { value: string; Label: () => string; }[]; }' is not assignable to parameter of type '({ name: string; value?: any; oninput?: ((event: any) => any) | undefined; radios: RadioItem[]; } & DefaultDesignProps & PropsAll<HTMLElement>) | undefined'.
Type '{ oninput: ({ target }: { target: HTMLInputElement; }) => void; name: string; value: string | null; radios: { value: string; Label: () => string; }[]; }' is not assignable to type 'undefined'. |
Not on my machine... Could you provide some info how you set up the project? I haven't used lerna before. ~/src/bau % npx lerna run build
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
|
Also no problems on CI... |
I was able to reproduce the error with your repo, are you on the right branch ? |
fixed in PR #144 Thanks a lot! |
@FredericHeem Curious... How do I set up lerna? Could you maybe add a few words to the README.md for developers? |
Backward compatible version of #108.
HTMLElement
. This way, you don't have to manually specify it (which is especially painful in JavaScript).target
on the event automatically as well, so you also don't need to manually set that.oninput
. UseInputEvent
there.Tested with TS examples and bau-kit for backward compatibility. Looks good.
In a follow-up PR all the explicit types could be removed. They are no longer needed.