Skip to content

Pass a context to rendered Component's child? #144

@jakubzitny

Description

@jakubzitny

I am using enzyme.mount to render a Component with some child Components and I need to pass a context to these child Components. I can pass a context with options.context to the Component but I would like to pass something else to Component's children.

The options object in mount would be good place to do this, however, it is currently not possible. I know I can create my own wrapper with childContextTypes, but for better readability and simplicity of tests, to do this directly with enzyme.mount would be amazing.

What do you think?

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