Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteebe0c6

Browse files
committed
feat: add version check
1 parenta488fe9 commiteebe0c6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎integrations/react/src/stable/stackflow.tsx‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import { useActions } from "./useActions";
2626
importtype{UseStepActionsOutputType}from"./useStepActions";
2727
import{useStepActions}from"./useStepActions";
2828

29+
import{version}from"react";
30+
2931
functionparseActionOptions(options?:{animate?:boolean}){
3032
if(!options){
3133
return{skipActiveState:false};
@@ -145,9 +147,18 @@ export function stackflow<T extends BaseActivities>(
145147
...(options.plugins??[])
146148
.flat(Number.POSITIVE_INFINITYas0)
147149
.map((p)=>pasStackflowReactPlugin),
148-
lazyActivityPlugin(activityComponentMap),
149150
];
150151

152+
constmajorReactVersion=Number.parseInt(version);
153+
154+
/**
155+
* TODO: This plugin depends on internal APIs of React.
156+
* A proper solution (e.g. Suspense integration) should be implemented in the next major version.
157+
*/
158+
if(majorReactVersion>=18&&majorReactVersion<=19){
159+
plugins.push(lazyActivityPlugin(activityComponentMap));
160+
}
161+
151162
constenoughPastTime=()=>
152163
newDate().getTime()-options.transitionDuration*2;
153164

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp