Skip to content

Support dot notation in reactpy.web.export #543

@Archmonger

Description

@Archmonger

Current Situation

Currently nested imports cannot be resolved, such as Bootstrap Navbar.Toggle

bootstrap = reactpy.web.module_from_template(
    "react", "react-bootstrap", resolve_exports=True
)
toggler = reactpy.web.export(bootstrap, "Navbar.Toggle")

Proposed Changes

Update reactpy.web.export to support dot notation by modifying this check to drill down into the module using the dot-separate names rather than just checking to see if it's a direct export. Here's how this could be done.

For more information see this comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag-good-first-issueA well defined and self-contained task.priority-3-lowMay be resolved one any timeline.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions