Skip to content

When utilizing shared mithril components imported from another node package, mithril render and routing do not work as expected #2662

Closed
@omenking

Description

@omenking

Mithril version:

2.0.4

Browser and OS:
Chrome, MacOS and Windows10

Project:

https://github.com/omenking/mithril_issue

Code

https://github.com/omenking/mithril_issue

Expected Behavior and Current Behavior

https://github.com/omenking/mithril_issue

1. Routing

When using m.route.Link within the shared_ui/nav.js the url ends up as follows:

http://localhost:8080/hello#!/world

instead of the expected:

http://localhost:8080/world

2. Rendering

When using m.request within the shared_ui/notifications.js the success function is suppose to trigger a redraw but it does not. Adding an explicit redraw() does nothing with the component.

Steps to Reproduce

I made a video demonstrating the two issues:

https://youtu.be/GIJiAK7eGwc

Context

I am refactoring my large monolithic application into smaller front-end web-apps based on domain. I have created a UI Kit for and common components eg Header, UserDropDown, Notifications to use across these frontends.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: QuestionFor issues that are purely questions about Mithril, not necessarily bug reports or suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions