Could you use slots for showing authorized or unauthorized site? #2025
-
I am just looking through all the examples and I saw the one with slots. I cant read anything about it in the docs and it does not say much about it in the readme. It makes sense that you can use it for anything conditional, but I am wondering if showing things based on authstate is a good use case? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Just to be clear, here are the docs for the It doesn't have anything to do with conditionality in itself, that is just the example given. It is mostly a syntax sugar: in the example you're referring to, writing
is an alternative to something like
|
Beta Was this translation helpful? Give feedback.
Just to be clear, here are the docs for the
#[slot]
macro. It is used to allow you to provide some kind of typed as a prop to another component, and to build that data using the component syntax itself.It doesn't have anything to do with conditionality in itself, that is just the example given. It is mostly a syntax sugar: in the example you're referring to, writing