File tree Expand file tree Collapse file tree 1 file changed +13
-19
lines changed Expand file tree Collapse file tree 1 file changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,9 @@ pub fn Component() -> yew::Html {
60
60
let context = yew:: functional:: use_reducer ( Context :: default) ;
61
61
62
62
yew:: html! {
63
- <ComponentLoc { context} />
63
+ <yew:: ContextProvider <crate :: Context > context={ context. clone( ) } >
64
+ <ComponentLoc { context} />
65
+ </yew:: ContextProvider <crate :: Context >>
64
66
}
65
67
}
66
68
@@ -167,25 +169,17 @@ impl yew::Component for ComponentLoc {
167
169
should_render
168
170
}
169
171
170
- fn view ( & self , ctx : & yew:: Context < Self > ) -> yew:: Html {
171
- let context = & ctx. props ( ) . context ;
172
-
173
- yew:: html! {
174
- <yew:: ContextProvider <crate :: Context > context={ context. clone( ) } >
175
- {
176
- if self . auth {
177
- yew:: html! {
178
- <yew_router:: router:: BrowserRouter >
179
- <yew_router:: Switch <Route > render={ switch } />
180
- </yew_router:: router:: BrowserRouter >
181
- }
182
- } else {
183
- yew:: html! {
184
- <super :: Login />
185
- }
186
- }
172
+ fn view ( & self , _: & yew:: Context < Self > ) -> yew:: Html {
173
+ if self . auth {
174
+ yew:: html! {
175
+ <yew_router:: router:: BrowserRouter >
176
+ <yew_router:: Switch <Route > render={ switch } />
177
+ </yew_router:: router:: BrowserRouter >
178
+ }
179
+ } else {
180
+ yew:: html! {
181
+ <super :: Login />
187
182
}
188
- </yew:: ContextProvider <crate :: Context >>
189
183
}
190
184
}
191
185
You can’t perform that action at this time.
0 commit comments