add error message when overlapping fullstack features are enabled
This commit is contained in:
1 parent
1cf8f71368
commit
d9b32afd64
2 files changed
+16
-2
No files matched your search
@@ -121,8 +121,15 @@ impl<Props: Clone + serde::Serialize + serde::de::DeserializeOwned + Send + Sync
|
|||||||
#[cfg(feature = "web")]
|
#[cfg(feature = "web")]
|
||||||
/// Launch the web application
|
/// Launch the web application
|
||||||
pub fn launch_web(self) {
|
pub fn launch_web(self) {
|
||||||
let cfg = self.web_cfg.hydrate(true);
|
#[cfg(not(feature = "ssr"))]
|
||||||
dioxus_web::launch_with_props(self.component, get_root_props_from_document().unwrap(), cfg);
|
{
|
||||||
|
let cfg = self.web_cfg.hydrate(true);
|
||||||
|
dioxus_web::launch_with_props(
|
||||||
|
self.component,
|
||||||
|
get_root_props_from_document().unwrap(),
|
||||||
|
cfg,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "desktop")]
|
#[cfg(feature = "desktop")]
|
||||||
|
|||||||
@@ -64,3 +64,10 @@ pub mod prelude {
|
|||||||
|
|
||||||
pub use hooks::{server_cached::server_cached, server_future::use_server_future};
|
pub use hooks::{server_cached::server_cached, server_future::use_server_future};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Warn users about overlapping features
|
||||||
|
#[cfg(all(feature = "ssr", feature = "web"))]
|
||||||
|
compile_error!("The `ssr` feature (enabled by `warp`, `axum`, or `salvo`) and `web` feature are overlapping. Please choose one or the other.");
|
||||||
|
|
||||||
|
#[cfg(all(feature = "ssr", feature = "desktop"))]
|
||||||
|
compile_error!("The `ssr` feature (enabled by `warp`, `axum`, or `salvo`) and `desktop` feature are overlapping. Please choose one or the other.");
|
||||||
Reference in new issue
Block a user