File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66use std:: future:: Future ;
77
8- use crate :: html:: { Scope , Scoped } ;
8+ use crate :: html:: Scope ;
99use crate :: suspense:: Suspension ;
1010use crate :: { BaseComponent , Context , HtmlResult } ;
1111
@@ -104,7 +104,17 @@ impl<C: LazyComponent> BaseComponent for Lazy<C> {
104104 type Properties = <C :: Underlying as BaseComponent >:: Properties ;
105105
106106 fn create ( ctx : & Context < Self > ) -> Self {
107- let inner_scope = Scope :: new ( Some ( ctx. link ( ) . to_any ( ) ) ) ;
107+ #[ cfg( not( any( feature = "ssr" , feature = "csr" ) ) ) ]
108+ {
109+ let _ = ctx;
110+ todo ! ( "Component shouldn't render without any rendering mode enabled" ) ;
111+ }
112+ #[ allow( unreachable_code) ]
113+ let inner_scope;
114+ #[ cfg( any( feature = "ssr" , feature = "csr" ) ) ]
115+ {
116+ inner_scope = Scope :: new ( Some ( ctx. link ( ) . clone ( ) . into ( ) ) ) ;
117+ }
108118 let creation_ctx = ctx. narrow_scope ( & inner_scope) ;
109119
110120 let link = ctx. link ( ) . clone ( ) ;
You can’t perform that action at this time.
0 commit comments