Skip to content

Commit 7f90169

Browse files
authored
Update react types to 19.0.2 (#250)
1 parent 10adce8 commit 7f90169

File tree

4 files changed

+288
-288
lines changed

4 files changed

+288
-288
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"next-yak": patch
3+
"yak-swc": patch
4+
---
5+
6+
Updated @types/react to 19.0.2

packages/next-yak/runtime/styled.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ import type { YakTheme } from "./context/index.d.ts";
2020
*/
2121
const noTheme: YakTheme = {};
2222

23-
/**
24-
* Minimal type for a function component that works with next-yak
25-
*/
26-
type FunctionComponent<T> = (
27-
props: T,
28-
context?: any,
29-
) => React.ReactNode | React.ReactElement;
30-
3123
/**
3224
* All valid html tags
3325
*/
@@ -70,7 +62,7 @@ type Attrs<
7062
// https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/constructors/styled.tsx
7163
// https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/models/StyledComponent.ts
7264
//
73-
const StyledFactory = <T,>(Component: HtmlTags | FunctionComponent<T>) =>
65+
const StyledFactory = <T,>(Component: HtmlTags | React.FunctionComponent<T>) =>
7466
Object.assign(yakStyled(Component), {
7567
attrs: <
7668
TAttrsIn extends object = {},
@@ -89,13 +81,13 @@ type YakComponent<
8981
T,
9082
TAttrsIn extends object = {},
9183
TAttrsOut extends AttrsMerged<T, TAttrsIn> = AttrsMerged<T, TAttrsIn>,
92-
> = FunctionComponent<
84+
> = React.FunctionComponent<
9385
T & {
9486
css?: StaticCSSProp;
9587
}
9688
> & {
9789
[yakComponentSymbol]: [
98-
FunctionComponent<T>,
90+
React.FunctionComponent<T>,
9991
AttrsFunction<T, TAttrsIn, TAttrsOut>,
10092
];
10193
};
@@ -106,7 +98,7 @@ const yakStyled = <
10698
TAttrsOut extends AttrsMerged<T, TAttrsIn> = AttrsMerged<T, TAttrsIn>,
10799
>(
108100
Component:
109-
| FunctionComponent<T>
101+
| React.FunctionComponent<T>
110102
| YakComponent<T, TAttrsIn, TAttrsOut>
111103
| HtmlTags,
112104
attrs?: Attrs<T, TAttrsIn, TAttrsOut>,

0 commit comments

Comments
 (0)