reactpy icon indicating copy to clipboard operation
reactpy copied to clipboard

Support dot notation in reactpy.web.export

Open Archmonger opened this issue 4 years ago • 1 comments

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.

Archmonger avatar Dec 11 '21 05:12 Archmonger

Gonna push this to 2.0 since it's more of a nicety.

rmorshea avatar Nov 29 '22 19:11 rmorshea