Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

use_supported

SSR compatibe is_supported

Usage

use leptos::prelude::*;
use leptos_use::{use_supported, js};
use wasm_bindgen::JsValue;

pub fn Demo() -> impl IntoView {
let is_supported = use_supported(
    || js!("getBattery" in &window().navigator())
);

if is_supported.get() {
    // do something
}
   view! { }
}

Feature

This function is only available if the crate feature use_supported is enabled

Source

Source • Docs