Skip to content
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

Empty views no longer work #518

Closed
WafflePersonThing opened this issue Feb 13, 2023 · 1 comment
Closed

Empty views no longer work #518

WafflePersonThing opened this issue Feb 13, 2023 · 1 comment

Comments

@WafflePersonThing
Copy link
Contributor

WafflePersonThing commented Feb 13, 2023

last working rev: db3f46c

error[E0425]: cannot find value `Unit` in crate `leptos`
   --> frontend/src/lib.rs
    |
    |             view=|cx| view!{cx,}
    |                       ^^^^^^^^^^ not found in `leptos`
    |
    = note: this error originates in the macro `view` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
    |
5   | use crate::CoreComponent::Unit;
    |
5   | use crate::Unit;
    |
5   | use leptos_dom::CoreComponent::Unit;
    |
5   | use leptos_dom::Unit;
    |
@gbj
Copy link
Collaborator

gbj commented Feb 13, 2023

Thanks. I can fix this tonight, it's easy and just has to do with the way I've reorganized module exports and missed one in the macro.

I'll also say you can just use the unit type () anywhere you'd use the empty view! { cx, } -- especially since it's shorter and saves you a macro invocation, so compiles a bit faster too!

@gbj gbj closed this as completed in 50d8eae Feb 14, 2023
fundon added a commit to fundon/leptos that referenced this issue Feb 14, 2023
* main:
  Reexport `web-sys` event types in `leptos::ev` to make it easier to type handlers (leptos-rs#521)
  fix: correct namespace for `Unit` in empty views (closes leptos-rs#518) (leptos-rs#520)
  leptos_dom erros.rs remove<E>() does not need to be generic. (leptos-rs#516)
  `0.2.0-alpha` (leptos-rs#515)
  remove `.unwrap()` from `redirect` in Actix integration (leptos-rs#514)
  do not unwrap use_context in integrations axum redirect (leptos-rs#513)
  CI: fix Wasm testing (leptos-rs#511)
  fix: SSR export in Wasm mode (leptos-rs#512)
  fix: import in `leptos_dom` and add Wasm build to CI for regressions (leptos-rs#510)
  Typos and a small cleanup (leptos-rs#509)
  change: reorganize module exports and reexports (leptos-rs#503)
  Add docs on testing (closes leptos-rs#489) (leptos-rs#508)
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

No branches or pull requests

2 participants