Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Actor uses anonymous prinicpal whenever called in UseEffect react #29

@alejandrade

Description

@alejandrade

Code

    const [_factoryActor] = useCanister('factory', { mode: 'connected' });
    const factoryActor = _factoryActor as unknown as FACTORY_SERVICE;
    useEffect(() => {
        init();
    }, []);

    async function init() {
        const versions = await factoryActor.getRegistrationCost();
        setRegistrationCost(versions);
    }

I checked the principal before it calls and it's my wallet principal but once it reaches the canister, it's the anonymous principal.

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