Skip to content

While executing inline arrow function I have an error that the callback is not a function #223

@maalej

Description

@maalej

My react
const Greeting = ({ name, handleClick }: GreetingProps) => { return ( <div> <h1>Hello, {name}!</h1> <button onClick={() => handleClick(name)}>Click me</button> </div> ); };
My WC:
export const WCBasic = r2wc(Greeting, { props: { handleClick: "function", name: "string", }, });

My Angular template
<wc-basic title="Welcome to the Web Component" handle-click="onWcClick($event)" ></wc-basic>

My Angular component
onWcClick(event: any) { console.log('onWcClick', event); }

the error message:
Basic.tsx:27 Uncaught TypeError: handleClick is not a function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions