bitovi / bitovi/react-to-web-component
While executing inline arrow function I have an error that the callback is not a function
- Dominant language
- TypeScript
- Stars
- 944
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
My react
`const Greeting = ({ name, handleClick }: GreetingProps) => {
return (
Hello, {name}!
handleClick(name)}>Click me
);
};
`
My WC:
`
export const WCBasic = r2wc(Greeting, {
props: {
handleClick: "function",
name: "string",
},
});`
My Angular template
` `
My Angular component
` onWcClick(event: any) {
console.log('onWcClick', event);
}`
the error message:
`Basic.tsx:27 Uncaught TypeError: handleClick is not a function`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the error with the inline Greeting component, WCBasic wrapper, and Angular template shown in the issue. Trace how the handle-click value crosses the React-to-Web-Component boundary and identify why it is not callable; done means the Angular callback executes without the TypeError and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, react, typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100