Skip to content

How to properly test context API #209

Closed
@halafi

Description

@halafi

I haven't found much in docs, how can I pass context what normally would be done by a parent component?

if I do something like:

setContext('foo', {
    bar: { kek: 'bur' },
  });
 render(...);

I get an error: Function called outside component initialisation

and I haven't noticed a way to pass the context to render function call.

Is there any better way than creating a redundant component parent?

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