File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
flow-server/src/main/java/com/vaadin/flow/component/internal Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 41
41
import com .vaadin .flow .component .HasElement ;
42
42
import com .vaadin .flow .component .HeartbeatEvent ;
43
43
import com .vaadin .flow .component .HeartbeatListener ;
44
+ import com .vaadin .flow .component .Tag ;
44
45
import com .vaadin .flow .component .UI ;
45
46
import com .vaadin .flow .component .dependency .JavaScript ;
46
47
import com .vaadin .flow .component .dependency .StyleSheet ;
@@ -855,7 +856,13 @@ && getRouter().getRegistry()
855
856
.createComponent ((Class <? extends Component >) getClass ()
856
857
.getClassLoader ().loadClass (
857
858
"com.vaadin.flow.component.react.ReactRouterOutlet" ));
858
- ((RouterLayout ) target ).showRouterLayoutContent (reactOutlet );
859
+ RouterLayout layout = (RouterLayout ) target ;
860
+ layout .getElement ().getChildren ()
861
+ .filter (element -> element .getTag ()
862
+ .equals (reactOutlet .getClass ()
863
+ .getAnnotation (Tag .class ).value ()))
864
+ .forEach (Element ::removeFromParent );
865
+ layout .showRouterLayoutContent (reactOutlet );
859
866
} catch (ClassNotFoundException e ) {
860
867
throw new IllegalStateException (
861
868
"No ReactRouterOutlet available on classpath" , e );
You can’t perform that action at this time.
0 commit comments