File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable */
2- import { useContext , useState } from "react" ;
2+ import { useContext , useState , type ComponentType } from "react" ;
33import { Appearance } from "react-native" ;
44
55import type { StyleDescriptor } from "react-native-css/compiler" ;
@@ -30,6 +30,10 @@ export {
3030
3131export { useNativeCss } ;
3232
33+ const defaultMapping : StyledConfiguration < ComponentType < { style : unknown } > > = {
34+ className : "style" ,
35+ } ;
36+
3337/**
3438 * Generates a new Higher-Order component the wraps the base component and applies the styles.
3539 * This is added to the `interopComponents` map so that it can be used in the `wrapJSX` function
@@ -41,7 +45,7 @@ export const styled = <
4145 const M extends StyledConfiguration < C > ,
4246> (
4347 baseComponent : C ,
44- mapping : M ,
48+ mapping : M = defaultMapping as M ,
4549 options ?: StyledOptions ,
4650) => {
4751 let component : any ;
Original file line number Diff line number Diff line change 22 createElement ,
33 useMemo ,
44 type ComponentPropsWithRef ,
5+ type ComponentType ,
56 type PropsWithChildren ,
67} from "react" ;
78import { Appearance } from "react-native" ;
@@ -17,12 +18,16 @@ import type {
1718import type { ReactComponent } from "../runtime.types" ;
1819import { assignStyle } from "./assign-style" ;
1920
21+ const defaultMapping : StyledConfiguration < ComponentType < { style : unknown } > > = {
22+ className : "style" ,
23+ } ;
24+
2025export const styled = <
2126 const C extends ReactComponent ,
2227 const M extends StyledConfiguration < C > ,
2328> (
2429 baseComponent : C ,
25- mapping : M ,
30+ mapping : M = defaultMapping as M ,
2631 _options ?: StyledOptions ,
2732) => {
2833 return ( props : StyledProps < ComponentPropsWithRef < C > , M > ) => {
You can’t perform that action at this time.
0 commit comments