Skip to content

Add named export for use-presence #15

Open
@alfianandinugraha

Description

@alfianandinugraha

There is problem with use-presence in server environment for SSR. Currently we use Remixjs with SSR but there is an error regarding import statement

Here the problem:

Image

If we try import usePresence in node enviroment it will transform object like that. So we can't use hook directly like usePresence(). As a solution, I assume that since usePresenceSwitch is inside the object, we can export usePresence as well.

export {default} from './usePresence';
export {default as usePresence} from './usePresence';
export {default as usePresenceSwitch} from './usePresenceSwitch';

then we can import library like this:

import { usePresence } from "use-presence";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions