widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.62k stars 105 forks source link

https://solara.dev/documentation/advanced/understanding/routing has some errors in examples #616

Closed johnowhitaker closed 3 weeks ago

johnowhitaker commented 3 weeks ago

from solara.website.pages.examples.utilities import calculator gives an error, that doesn't seem to exist

import solara as sol but then the example uses solar

route_current, routes_current_level = solara.use_routes() gives me an error: AttributeError: module 'solara' has no attribute 'use_routes'

I think I'm on the latest version but maybe I'm out of sync somehow?

johnowhitaker commented 3 weeks ago

use_routes -> use_route at least is an easy fix :)

maartenbreddels commented 3 weeks ago

Thanks Jonathan!

I've fixed this in master. I have to say, we are leaning to doing explicit routes now https://github.com/widgetti/solara/issues/612#issuecomment-2066406696 Since most people get confused by it (including ourselves sometimes). Let me know what you think.

cheers,

Maarten

johnowhitaker commented 3 weeks ago

I like the explicit routes, definitely what I was planning to use :)