Skip to content

Links only work with string arguments #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stevej2608 opened this issue Nov 11, 2023 · 3 comments · Fixed by #30
Closed

Links only work with string arguments #27

stevej2608 opened this issue Nov 11, 2023 · 3 comments · Fixed by #30

Comments

@stevej2608
Copy link
Contributor

The following works:

link('Users', to='/users')

When I replace 'Users' with a html composite, eg:

button = html.button({'class_name': '...'},
            icon(),
            html.span({'class_name': ...'}, 'Users')
        )

link(button, to='/users')

The button composite is rendered as an empty <div></div>. The button composite renders correctly outside the link.

@stevej2608
Copy link
Contributor Author

I've done a quick hack here that goes some way to fixing the problem. I can now create links that include an SVG icon and a html.span() containing the link text.

I'm pretty sure it will choke on links that contain nested @component definitions.

@Archmonger
Copy link
Contributor

This is a more broad issue related to client-side components.

Right now, rendering server side components as a children of client-side components is really buggy.

@Archmonger
Copy link
Contributor

For traceability, here's another related issue with the link component.

I will check if the link component can be rewritten as a server-side component in the next reactpy_router version.

@Archmonger Archmonger linked a pull request Oct 12, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants