Fix the router and stub out a number of crates to get compiling
This commit is contained in:
226 files changed
+1057
-1482
No files matched your search
@@ -4,10 +4,10 @@ use tracing::error;
|
||||
use crate::utils::use_router_internal::use_router_internal;
|
||||
|
||||
/// The properties for a [`GoBackButton`] or a [`GoForwardButton`].
|
||||
#[derive(Debug, Props)]
|
||||
pub struct HistoryButtonProps<'a> {
|
||||
#[derive(Debug, Props, Clone, PartialEq)]
|
||||
pub struct HistoryButtonProps {
|
||||
/// The children to render within the generated HTML button tag.
|
||||
pub children: Element<'a>,
|
||||
pub children: Element,
|
||||
}
|
||||
|
||||
/// A button to go back through the navigation history. Similar to a browsers back button.
|
||||
@@ -31,14 +31,14 @@ pub struct HistoryButtonProps<'a> {
|
||||
/// }
|
||||
///
|
||||
/// #[component]
|
||||
/// fn App(cx: Scope) -> Element {
|
||||
/// fn App() -> Element {
|
||||
/// render! {
|
||||
/// Router::<Route> {}
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// #[component]
|
||||
/// fn Index(cx: Scope) -> Element {
|
||||
/// fn Index() -> Element {
|
||||
/// render! {
|
||||
/// GoBackButton {
|
||||
/// "go back"
|
||||
@@ -54,11 +54,14 @@ pub struct HistoryButtonProps<'a> {
|
||||
/// # );
|
||||
/// ```
|
||||
#[component]
|
||||
pub fn GoBackButton<'a>(cx: Scope<'a, HistoryButtonProps<'a>>) -> Element {
|
||||
let HistoryButtonProps { children } = cx.props;
|
||||
pub fn GoBackButton(
|
||||
/// The props...
|
||||
props: HistoryButtonProps,
|
||||
) -> Element {
|
||||
let HistoryButtonProps { children } = props;
|
||||
|
||||
// hook up to router
|
||||
let router = match use_router_internal(cx) {
|
||||
let router = match use_router_internal() {
|
||||
Some(r) => r,
|
||||
#[allow(unreachable_code)]
|
||||
None => {
|
||||
@@ -103,14 +106,14 @@ pub fn GoBackButton<'a>(cx: Scope<'a, HistoryButtonProps<'a>>) -> Element {
|
||||
/// }
|
||||
///
|
||||
/// #[component]
|
||||
/// fn App(cx: Scope) -> Element {
|
||||
/// fn App() -> Element {
|
||||
/// render! {
|
||||
/// Router::<Route> {}
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// #[component]
|
||||
/// fn Index(cx: Scope) -> Element {
|
||||
/// fn Index() -> Element {
|
||||
/// render! {
|
||||
/// GoForwardButton {
|
||||
/// "go forward"
|
||||
@@ -126,11 +129,14 @@ pub fn GoBackButton<'a>(cx: Scope<'a, HistoryButtonProps<'a>>) -> Element {
|
||||
/// # );
|
||||
/// ```
|
||||
#[component]
|
||||
pub fn GoForwardButton<'a>(cx: Scope<'a, HistoryButtonProps<'a>>) -> Element {
|
||||
let HistoryButtonProps { children } = cx.props;
|
||||
pub fn GoForwardButton(
|
||||
/// Props...
|
||||
props: HistoryButtonProps,
|
||||
) -> Element {
|
||||
let HistoryButtonProps { children } = props;
|
||||
|
||||
// hook up to router
|
||||
let router = match use_router_internal(cx) {
|
||||
let router = match use_router_internal() {
|
||||
Some(r) => r,
|
||||
#[allow(unreachable_code)]
|
||||
None => {
|
||||
|
||||
Reference in new issue
Block a user