File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
main/java/com/vaadin/flow/server/frontend
test/java/com/vaadin/flow/server/frontend Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 8
8
import java .util .Objects ;
9
9
import java .util .Set ;
10
10
11
+ import org .slf4j .LoggerFactory ;
12
+
11
13
import com .vaadin .experimental .FeatureFlags ;
12
14
import com .vaadin .flow .di .Lookup ;
13
15
import com .vaadin .flow .server .Constants ;
@@ -928,6 +930,12 @@ public boolean isReactEnabled() {
928
930
929
931
public Options withReact (boolean reactEnable ) {
930
932
this .reactEnable = reactEnable ;
933
+ if (reactEnable && !FrontendUtils
934
+ .isReactRouterRequired (getFrontendDirectory ())) {
935
+ LoggerFactory .getLogger (Options .class ).debug (
936
+ "Setting reactEnable to false as Vaadin Router is used!" );
937
+ this .reactEnable = false ;
938
+ }
931
939
return this ;
932
940
}
933
941
Original file line number Diff line number Diff line change @@ -568,6 +568,9 @@ public void getDefaultDependencies_reactIsUsed_addsHillaReactComponents() {
568
568
.mockStatic (FrontendUtils .class )) {
569
569
mock .when (() -> FrontendUtils .isHillaUsed (Mockito .any (File .class ),
570
570
Mockito .any (ClassFinder .class ))).thenReturn (true );
571
+ mock .when (() -> FrontendUtils
572
+ .isReactRouterRequired (Mockito .any (File .class )))
573
+ .thenReturn (true );
571
574
options .withReact (true );
572
575
Map <String , String > defaultDeps = nodeUpdater
573
576
.getDefaultDependencies ();
You can’t perform that action at this time.
0 commit comments