fix extending an element
This commit is contained in:
1 parent
d573f5dfd5
commit
dc446b5e5b
10 files changed
+137
-88
No files matched your search
@@ -661,7 +661,7 @@ Finally, call `.build()` to create the instance of `{name}`.
|
|||||||
{
|
{
|
||||||
type Builder = #builder_name #generics_with_empty;
|
type Builder = #builder_name #generics_with_empty;
|
||||||
const IS_STATIC: bool = #is_static;
|
const IS_STATIC: bool = #is_static;
|
||||||
fn builder() -> Self::Builder {
|
fn builder(_cx: &::dioxus_core::prelude::ScopeState) -> Self::Builder {
|
||||||
#name::builder()
|
#name::builder()
|
||||||
}
|
}
|
||||||
unsafe fn memoize(&self, other: &Self) -> bool {
|
unsafe fn memoize(&self, other: &Self) -> bool {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ impl<'a, const A: bool> FragmentBuilder<'a, A> {
|
|||||||
impl<'a> Properties for FragmentProps<'a> {
|
impl<'a> Properties for FragmentProps<'a> {
|
||||||
type Builder = FragmentBuilder<'a, false>;
|
type Builder = FragmentBuilder<'a, false>;
|
||||||
const IS_STATIC: bool = false;
|
const IS_STATIC: bool = false;
|
||||||
fn builder() -> Self::Builder {
|
fn builder(_cx: &ScopeState) -> Self::Builder {
|
||||||
FragmentBuilder(None)
|
FragmentBuilder(None)
|
||||||
}
|
}
|
||||||
unsafe fn memoize(&self, _other: &Self) -> bool {
|
unsafe fn memoize(&self, _other: &Self) -> bool {
|
||||||
|
|||||||
@@ -73,11 +73,11 @@ pub(crate) mod innerlude {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub use crate::innerlude::{
|
pub use crate::innerlude::{
|
||||||
fc_to_builder, vdom_is_rendering, AnyValue, Attribute, AttributeBox, AttributeValue, BorrowedAttributeValue,
|
fc_to_builder, vdom_is_rendering, AnyValue, Attribute, AttributeValue, BorrowedAttributeValue,
|
||||||
CapturedError, Component, DynamicNode, Element, ElementId, Event, Fragment, HasAttributesBox, IntoDynNode,
|
CapturedError, Component, DynamicNode, Element, ElementId, Event, Fragment, HasAttributesBox,
|
||||||
LazyNodes, Mutation, Mutations, Properties, RenderReturn, Scope, ScopeId, ScopeState, Scoped,
|
IntoDynNode, LazyNodes, Mutation, Mutations, Properties, RenderReturn, Scope, ScopeId,
|
||||||
TaskId, Template, TemplateAttribute, TemplateNode, VComponent, VNode, VPlaceholder, VText,
|
ScopeState, Scoped, TaskId, Template, TemplateAttribute, TemplateNode, VComponent, VNode,
|
||||||
VirtualDom,
|
VPlaceholder, VText, VirtualDom,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The purpose of this module is to alleviate imports of many common types
|
/// The purpose of this module is to alleviate imports of many common types
|
||||||
|
|||||||
@@ -833,33 +833,12 @@ impl<'a, T: IntoAttributeValue<'a>> IntoAttributeValue<'a> for Option<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct AttributeBox<'a> {
|
|
||||||
/// The name of the attribute.
|
|
||||||
pub name: &'a str,
|
|
||||||
|
|
||||||
/// The value of the attribute
|
|
||||||
pub value: Box<dyn IntoAttributeValue<'a> + 'static>,
|
|
||||||
|
|
||||||
/// The namespace of the attribute.
|
|
||||||
///
|
|
||||||
/// Doesn’t exist in the html spec. Used in Dioxus to denote “style” tags and other attribute groups.
|
|
||||||
pub namespace: Option<&'static str>,
|
|
||||||
|
|
||||||
/// An indication of we should always try and set the attribute. Used in controlled components to ensure changes are propagated
|
|
||||||
pub volatile: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> AttributeBox<'a> {
|
|
||||||
pub fn new(name: &'a str, value: impl IntoAttributeValue<'a> + 'static, namespace: Option<&'static str>, volatile: bool) -> Self {
|
|
||||||
Self {
|
|
||||||
name,
|
|
||||||
value: Box::new(value),
|
|
||||||
namespace,
|
|
||||||
volatile,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait HasAttributesBox<'a, T> {
|
pub trait HasAttributesBox<'a, T> {
|
||||||
fn push_attribute(self, attr: AttributeBox<'a>) -> T;
|
fn push_attribute(
|
||||||
|
self,
|
||||||
|
name: &str,
|
||||||
|
ns: Option<&str>,
|
||||||
|
attr: impl IntoAttributeValue<'a>,
|
||||||
|
volatile: bool,
|
||||||
|
) -> T;
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ pub trait Properties: Sized {
|
|||||||
const IS_STATIC: bool;
|
const IS_STATIC: bool;
|
||||||
|
|
||||||
/// Create a builder for this component.
|
/// Create a builder for this component.
|
||||||
fn builder() -> Self::Builder;
|
fn builder(cx: &ScopeState) -> Self::Builder;
|
||||||
|
|
||||||
/// Memoization can only happen if the props are valid for the 'static lifetime
|
/// Memoization can only happen if the props are valid for the 'static lifetime
|
||||||
///
|
///
|
||||||
@@ -54,7 +54,7 @@ pub trait Properties: Sized {
|
|||||||
impl Properties for () {
|
impl Properties for () {
|
||||||
type Builder = EmptyBuilder;
|
type Builder = EmptyBuilder;
|
||||||
const IS_STATIC: bool = true;
|
const IS_STATIC: bool = true;
|
||||||
fn builder() -> Self::Builder {
|
fn builder(_cx: &ScopeState) -> Self::Builder {
|
||||||
EmptyBuilder {}
|
EmptyBuilder {}
|
||||||
}
|
}
|
||||||
unsafe fn memoize(&self, _other: &Self) -> bool {
|
unsafe fn memoize(&self, _other: &Self) -> bool {
|
||||||
@@ -70,8 +70,11 @@ impl EmptyBuilder {
|
|||||||
|
|
||||||
/// This utility function launches the builder method so rsx! and html! macros can use the typed-builder pattern
|
/// This utility function launches the builder method so rsx! and html! macros can use the typed-builder pattern
|
||||||
/// to initialize a component's props.
|
/// to initialize a component's props.
|
||||||
pub fn fc_to_builder<'a, T: Properties + 'a>(_: fn(Scope<'a, T>) -> Element<'a>) -> T::Builder {
|
pub fn fc_to_builder<'a, T: Properties + 'a>(
|
||||||
T::builder()
|
cx: &ScopeState,
|
||||||
|
_: fn(Scope<'a, T>) -> Element<'a>,
|
||||||
|
) -> T::Builder {
|
||||||
|
T::builder(cx)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(miri))]
|
#[cfg(not(miri))]
|
||||||
|
|||||||
@@ -1,51 +1,83 @@
|
|||||||
use dioxus::core_macro::render;
|
use dioxus::core_macro::render;
|
||||||
use dioxus::prelude::rsx;
|
use dioxus::prelude::rsx;
|
||||||
use dioxus_core::{AttributeBox, Element, HasAttributesBox, Scope};
|
use dioxus_core::{Attribute, Element, HasAttributesBox, Scope};
|
||||||
use dioxus_html::{ExtendedAudioMarker, ExtendedGlobalAttributesMarker};
|
use dioxus_html::{ExtendedAudioMarker, ExtendedGlobalAttributesMarker};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn props_spread() {
|
fn props_spread() {
|
||||||
pub struct FooProps<'a> {
|
pub struct FooProps<'a> {
|
||||||
pub open: Option<&'a str>,
|
pub open: Option<&'a str>,
|
||||||
attributes: Vec<AttributeBox<'a>>,
|
attributes: Vec<Attribute<'a>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----
|
// -----
|
||||||
impl<'a> FooProps<'a> {
|
impl<'a> FooProps<'a> {
|
||||||
#[doc = "\nCreate a builder for building `FooProps`.\nOn the builder, call `.open(...)`(optional) to set the values of the fields.\nFinally, call `.build()` to create the instance of `FooProps`.\n "]
|
#[doc = "\nCreate a builder for building `FooProps`.\nOn the builder, call `.open(...)`(optional) to set the values of the fields.\nFinally, call `.build()` to create the instance of `FooProps`.\n "]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn builder() -> FooPropsBuilder<'a, ((), ), > {
|
pub fn builder(cx: &ScopeState) -> FooPropsBuilder<'a, ((),)> {
|
||||||
FooPropsBuilder { fields: ((), ), attributes: Vec::new(), _phantom: core::default::Default::default() }
|
FooPropsBuilder {
|
||||||
|
bump: cx.bump(),
|
||||||
|
fields: ((),),
|
||||||
|
attributes: Vec::new(),
|
||||||
|
_phantom: core::default::Default::default(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(dead_code, non_camel_case_types, non_snake_case)]
|
#[allow(dead_code, non_camel_case_types, non_snake_case)]
|
||||||
pub struct FooPropsBuilder<'a, TypedBuilderFields, > {
|
pub struct FooPropsBuilder<'a, TypedBuilderFields> {
|
||||||
|
bump: &'a ::dioxus::core::exports::bumpalo::Bump,
|
||||||
fields: TypedBuilderFields,
|
fields: TypedBuilderFields,
|
||||||
attributes: Vec<AttributeBox<'a>>,
|
attributes: Vec<Attribute<'a>>,
|
||||||
_phantom: ( core::marker::PhantomData<&'a ()> ),
|
_phantom: (core::marker::PhantomData<&'a ()>),
|
||||||
}
|
}
|
||||||
//impl<'a, TypedBuilderFields, > Clone for FooPropsBuilder<'a, TypedBuilderFields, > where TypedBuilderFields: Clone { fn clone(&self) -> Self { Self { fields: self.fields.clone(), attributes: self.attributes, _phantom: Default::default() } } }
|
//impl<'a, TypedBuilderFields, > Clone for FooPropsBuilder<'a, TypedBuilderFields, > where TypedBuilderFields: Clone { fn clone(&self) -> Self { Self { fields: self.fields.clone(), attributes: self.attributes, _phantom: Default::default() } } }
|
||||||
impl<'a> dioxus::prelude::Properties for FooProps<'a> {
|
impl<'a> dioxus::prelude::Properties for FooProps<'a> {
|
||||||
type Builder = FooPropsBuilder<'a, ((), ), >;
|
type Builder = FooPropsBuilder<'a, ((),)>;
|
||||||
const IS_STATIC: bool = false;
|
const IS_STATIC: bool = false;
|
||||||
fn builder() -> Self::Builder { FooProps::builder() }
|
fn builder(cx: &ScopeState) -> Self::Builder {
|
||||||
unsafe fn memoize(&self, other: &Self) -> bool { false }
|
FooProps::builder(cx)
|
||||||
|
}
|
||||||
|
unsafe fn memoize(&self, other: &Self) -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(dead_code, non_camel_case_types, non_snake_case)]
|
#[allow(dead_code, non_camel_case_types, non_snake_case)]
|
||||||
pub trait FooPropsBuilder_Optional<T> { fn into_value<F: FnOnce() -> T>(self, default: F) -> T; }
|
pub trait FooPropsBuilder_Optional<T> {
|
||||||
impl<T> FooPropsBuilder_Optional<T> for () { fn into_value<F: FnOnce() -> T>(self, default: F) -> T { default() } }
|
fn into_value<F: FnOnce() -> T>(self, default: F) -> T;
|
||||||
impl<T> FooPropsBuilder_Optional<T> for (T, ) { fn into_value<F: FnOnce() -> T>(self, _: F) -> T { self.0 } }
|
}
|
||||||
|
impl<T> FooPropsBuilder_Optional<T> for () {
|
||||||
|
fn into_value<F: FnOnce() -> T>(self, default: F) -> T {
|
||||||
|
default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
impl<T> FooPropsBuilder_Optional<T> for (T,) {
|
||||||
|
fn into_value<F: FnOnce() -> T>(self, _: F) -> T {
|
||||||
|
self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
#[allow(dead_code, non_camel_case_types, missing_docs)]
|
#[allow(dead_code, non_camel_case_types, missing_docs)]
|
||||||
impl<'a> FooPropsBuilder<'a, ((), )> {
|
impl<'a> FooPropsBuilder<'a, ((),)> {
|
||||||
pub fn open(self, open: &'a str) -> FooPropsBuilder<'a, ((Option<&'a str>,
|
pub fn open(
|
||||||
// pub attributes: Vec<Attribute<'a>>,
|
self,
|
||||||
), )> {
|
open: &'a str,
|
||||||
let open = (Some(open), );
|
) -> FooPropsBuilder<
|
||||||
let (_, ) = self.fields;
|
'a,
|
||||||
FooPropsBuilder { fields: (open, ), attributes: self.attributes, _phantom: self._phantom }
|
((
|
||||||
|
Option<&'a str>,
|
||||||
|
// pub attributes: Vec<Attribute<'a>>,
|
||||||
|
),),
|
||||||
|
> {
|
||||||
|
let open = (Some(open),);
|
||||||
|
let (_,) = self.fields;
|
||||||
|
FooPropsBuilder {
|
||||||
|
bump: self.bump,
|
||||||
|
fields: (open,),
|
||||||
|
attributes: self.attributes,
|
||||||
|
_phantom: self._phantom,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
@@ -53,33 +85,67 @@ fn props_spread() {
|
|||||||
pub enum FooPropsBuilder_Error_Repeated_field_open {}
|
pub enum FooPropsBuilder_Error_Repeated_field_open {}
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[allow(dead_code, non_camel_case_types, missing_docs)]
|
#[allow(dead_code, non_camel_case_types, missing_docs)]
|
||||||
impl<'a> FooPropsBuilder<'a, ((Option<&'a str>,
|
impl<'a>
|
||||||
// pub attributes: Vec<Attribute<'a>>,
|
FooPropsBuilder<
|
||||||
), )> {
|
'a,
|
||||||
|
((
|
||||||
|
Option<&'a str>,
|
||||||
|
// pub attributes: Vec<Attribute<'a>>,
|
||||||
|
),),
|
||||||
|
>
|
||||||
|
{
|
||||||
#[deprecated(note = "Repeated field open")]
|
#[deprecated(note = "Repeated field open")]
|
||||||
pub fn open(self, _: FooPropsBuilder_Error_Repeated_field_open) -> FooPropsBuilder<'a, ((Option<&'a str>,
|
pub fn open(
|
||||||
// pub attributes: Vec<Attribute<'a>>,
|
self,
|
||||||
), )> { self }
|
_: FooPropsBuilder_Error_Repeated_field_open,
|
||||||
|
) -> FooPropsBuilder<
|
||||||
|
'a,
|
||||||
|
((
|
||||||
|
Option<&'a str>,
|
||||||
|
// pub attributes: Vec<Attribute<'a>>,
|
||||||
|
),),
|
||||||
|
> {
|
||||||
|
self
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#[allow(dead_code, non_camel_case_types, missing_docs)]
|
#[allow(dead_code, non_camel_case_types, missing_docs)]
|
||||||
impl<'a, __open: FooPropsBuilder_Optional<Option<&'a str>>> FooPropsBuilder<'a, (__open, ), > {
|
impl<'a, __open: FooPropsBuilder_Optional<Option<&'a str>>> FooPropsBuilder<'a, (__open,)> {
|
||||||
pub fn build(self) -> FooProps<'a> {
|
pub fn build(self) -> FooProps<'a> {
|
||||||
let (open, ) = self.fields;
|
let (open,) = self.fields;
|
||||||
let open = FooPropsBuilder_Optional::into_value(open, || Default::default());
|
let open = FooPropsBuilder_Optional::into_value(open, || Default::default());
|
||||||
FooProps { open, attributes: self.attributes }
|
FooProps {
|
||||||
|
open,
|
||||||
|
attributes: self.attributes,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// -----
|
// -----
|
||||||
|
|
||||||
impl<'a, A> HasAttributesBox<'a, FooPropsBuilder<'a, (A, )>> for FooPropsBuilder<'a, (A, )> {
|
impl<'a, A> HasAttributesBox<'a, FooPropsBuilder<'a, (A,)>> for FooPropsBuilder<'a, (A,)> {
|
||||||
fn push_attribute(self, attr: AttributeBox<'a>) -> FooPropsBuilder<'a, (A, )> {
|
fn push_attribute(
|
||||||
|
self,
|
||||||
|
name: &str,
|
||||||
|
ns: Option<&str>,
|
||||||
|
attr: impl IntoAttributeValue<'a>,
|
||||||
|
volatile: bool,
|
||||||
|
) -> Self {
|
||||||
let mut attrs = Vec::from(self.attributes);
|
let mut attrs = Vec::from(self.attributes);
|
||||||
attrs.push(attr);
|
attrs.push(Attribute::new(
|
||||||
FooPropsBuilder { fields: self.fields, attributes: attrs, _phantom: self._phantom }
|
name,
|
||||||
|
attr.into_value(self.bump),
|
||||||
|
ns,
|
||||||
|
volatile,
|
||||||
|
));
|
||||||
|
FooPropsBuilder {
|
||||||
|
bump: self.bump,
|
||||||
|
fields: self.fields,
|
||||||
|
attributes: attrs,
|
||||||
|
_phantom: self._phantom,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl<A,> ExtendedGlobalAttributesMarker for FooPropsBuilder<'_, (A,)> {}
|
impl<A> ExtendedGlobalAttributesMarker for FooPropsBuilder<'_, (A,)> {}
|
||||||
impl<A,> ExtendedAudioMarker for FooPropsBuilder<'_, (A,)> {}
|
impl<A> ExtendedAudioMarker for FooPropsBuilder<'_, (A,)> {}
|
||||||
|
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use dioxus_html::AudioExtension;
|
use dioxus_html::AudioExtension;
|
||||||
@@ -87,7 +153,7 @@ fn props_spread() {
|
|||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
pub fn Foo<'a>(cx: Scope<'a, FooProps<'a>>) -> Element<'a> {
|
pub fn Foo<'a>(cx: Scope<'a, FooProps<'a>>) -> Element<'a> {
|
||||||
let muted = false;
|
let muted = false;
|
||||||
let attributes = cx.props.attributes;
|
let attributes = &cx.props.attributes;
|
||||||
render! {
|
render! {
|
||||||
// rsx! {
|
// rsx! {
|
||||||
// audio {
|
// audio {
|
||||||
@@ -99,7 +165,7 @@ fn props_spread() {
|
|||||||
let mut attrs = vec![__cx.attr(dioxus_elements::audio::muted.0, muted, dioxus_elements::audio::muted.1, dioxus_elements::audio::muted.2)];
|
let mut attrs = vec![__cx.attr(dioxus_elements::audio::muted.0, muted, dioxus_elements::audio::muted.1, dioxus_elements::audio::muted.2)];
|
||||||
for attr in attributes {
|
for attr in attributes {
|
||||||
attrs.push(__cx.attr(attr.name, attr.value.into_value(__cx.bump()), attr.namespace, attr.volatile));
|
attrs.push(__cx.attr(attr.name, attr.value.into_value(__cx.bump()), attr.namespace, attr.volatile));
|
||||||
};
|
}
|
||||||
::dioxus::core::VNode {
|
::dioxus::core::VNode {
|
||||||
parent: None,
|
parent: None,
|
||||||
key: None,
|
key: None,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
use proc_macro::TokenStream;
|
use proc_macro::TokenStream;
|
||||||
|
|
||||||
use convert_case::{Case, Casing};
|
use convert_case::{Case, Casing};
|
||||||
use quote::{quote, TokenStreamExt, ToTokens};
|
use quote::{quote, ToTokens, TokenStreamExt};
|
||||||
use syn::{braced, Ident, parse_macro_input, Token};
|
|
||||||
use syn::__private::TokenStream2;
|
use syn::__private::TokenStream2;
|
||||||
use syn::parse::{Parse, ParseStream};
|
use syn::parse::{Parse, ParseStream};
|
||||||
use syn::punctuated::Punctuated;
|
use syn::punctuated::Punctuated;
|
||||||
|
use syn::{braced, parse_macro_input, Ident, Token};
|
||||||
|
|
||||||
#[proc_macro]
|
#[proc_macro]
|
||||||
pub fn impl_extension_attributes(input: TokenStream) -> TokenStream {
|
pub fn impl_extension_attributes(input: TokenStream) -> TokenStream {
|
||||||
@@ -42,11 +42,14 @@ impl ToTokens for ImplExtensionAttributes {
|
|||||||
let camel_name = name.to_string().to_case(Case::UpperCamel);
|
let camel_name = name.to_string().to_case(Case::UpperCamel);
|
||||||
let impl_name = Ident::new(format!("{}Impl", &camel_name).as_str(), name.span());
|
let impl_name = Ident::new(format!("{}Impl", &camel_name).as_str(), name.span());
|
||||||
let extension_name = Ident::new(format!("{}Extension", &camel_name).as_str(), name.span());
|
let extension_name = Ident::new(format!("{}Extension", &camel_name).as_str(), name.span());
|
||||||
let marker_name = Ident::new(format!("Extended{}Marker", &camel_name).as_str(), name.span());
|
let marker_name = Ident::new(
|
||||||
|
format!("Extended{}Marker", &camel_name).as_str(),
|
||||||
|
name.span(),
|
||||||
|
);
|
||||||
|
|
||||||
if !self.is_element {
|
if !self.is_element {
|
||||||
tokens.append_all(quote! {
|
tokens.append_all(quote! {
|
||||||
trait #impl_name {}
|
struct #impl_name;
|
||||||
impl #name for #impl_name {}
|
impl #name for #impl_name {}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -60,12 +63,12 @@ impl ToTokens for ImplExtensionAttributes {
|
|||||||
let d = if self.is_element {
|
let d = if self.is_element {
|
||||||
quote! { #name::#ident }
|
quote! { #name::#ident }
|
||||||
} else {
|
} else {
|
||||||
quote! { #impl_name::#ident }
|
quote! { <#impl_name as #name>::#ident }
|
||||||
};
|
};
|
||||||
quote! {
|
quote! {
|
||||||
fn #ident(self, value: impl IntoAttributeValue<'a> + 'static) -> Self {
|
fn #ident(self, value: impl IntoAttributeValue<'a> + 'static) -> Self {
|
||||||
let d = #d;
|
let d = #d;
|
||||||
self.push_attribute(AttributeBox::new(d.0, value, d.1, d.2))
|
self.push_attribute(d.0, d.1, value, d.2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
#![allow(non_upper_case_globals)]
|
#![allow(non_upper_case_globals)]
|
||||||
|
|
||||||
use dioxus_core::AttributeBox;
|
|
||||||
use dioxus_core::HasAttributesBox;
|
|
||||||
use dioxus_core::prelude::IntoAttributeValue;
|
use dioxus_core::prelude::IntoAttributeValue;
|
||||||
|
use dioxus_core::HasAttributesBox;
|
||||||
use dioxus_html_internal_macro::impl_extension_attributes;
|
use dioxus_html_internal_macro::impl_extension_attributes;
|
||||||
#[cfg(feature = "hot-reload-context")]
|
#[cfg(feature = "hot-reload-context")]
|
||||||
use dioxus_rsx::HotReloadingContext;
|
use dioxus_rsx::HotReloadingContext;
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
#![allow(non_upper_case_globals)]
|
#![allow(non_upper_case_globals)]
|
||||||
|
|
||||||
use dioxus_core::HasAttributesBox;
|
|
||||||
use dioxus_core::AttributeBox;
|
|
||||||
use dioxus_core::prelude::IntoAttributeValue;
|
use dioxus_core::prelude::IntoAttributeValue;
|
||||||
|
use dioxus_core::HasAttributesBox;
|
||||||
use dioxus_html_internal_macro::impl_extension_attributes;
|
use dioxus_html_internal_macro::impl_extension_attributes;
|
||||||
|
|
||||||
use crate::AttributeDiscription;
|
use crate::AttributeDiscription;
|
||||||
|
|||||||
@@ -151,8 +151,8 @@ impl ToTokens for Component {
|
|||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
let mut toks = match prop_gen_args {
|
let mut toks = match prop_gen_args {
|
||||||
Some(gen_args) => quote! { fc_to_builder(#name #gen_args) },
|
Some(gen_args) => quote! { fc_to_builder(__cx, #name #gen_args) },
|
||||||
None => quote! { fc_to_builder(#name) },
|
None => quote! { fc_to_builder(__cx, #name) },
|
||||||
};
|
};
|
||||||
for field in &self.fields {
|
for field in &self.fields {
|
||||||
match field.name.to_string().as_str() {
|
match field.name.to_string().as_str() {
|
||||||
|
|||||||
Reference in new issue
Block a user