Skip to content
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

react use svelte web component [cant handle event] #3712

Closed
runnerSnail opened this issue Oct 15, 2019 · 2 comments
Closed

react use svelte web component [cant handle event] #3712

runnerSnail opened this issue Oct 15, 2019 · 2 comments

Comments

@runnerSnail
Copy link

runnerSnail commented Oct 15, 2019

svelte
image

svelte compile custom web components
image

react use
image

but i cant handle custom event [message]

@dxlbnl
Copy link
Contributor

dxlbnl commented Oct 23, 2019

Think it's due to createEventDispatcher only handling 'svelte' events. if you check the code, you'll notice callbacks to be empty in your usecase.

function createEventDispatcher() {
    const component = current_component;
    return (type, detail) => {
        const callbacks = component.$$.callbacks[type];
        if (callbacks) {
            // TODO are there situations where events could be dispatched
            // in a server (non-DOM) environment?
            const event = custom_event(type, detail);
            callbacks.slice().forEach(fn => {
                fn.call(component, event);
            });
        }
    };
}

@TehShrike
Copy link
Member

This is indeed a bug. Duplicate of #3119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants