Skip to content

Commit

Permalink
fix(hmr): subapp v1 (#2024)
Browse files Browse the repository at this point in the history
Co-authored-by: shubham2811 <shubham.sharma3@walmart.com>
  • Loading branch information
shubham2811 and shubham2811 authored Sep 6, 2024
1 parent a2aff6e commit 16ebc15
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
10 changes: 10 additions & 0 deletions common/changes/subapp-web/fix-hmr-subappV1_2024-09-06-16-32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "subapp-web",
"comment": "fix hmr error",
"type": "patch"
}
],
"packageName": "subapp-web"
}
13 changes: 11 additions & 2 deletions packages/subapp-web/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function loadSubApp(info, renderStart, options) {
subApp.start = (instance, options, info) => {
instance = instance || subApp.preStart(instance, options, info);
info = info || subApp.info;
if (instance && !instance.props) {
if (instance && !instance.props && options) {
instance.props = options.props;
}
// if user provided a start function, then user is expected to
Expand Down Expand Up @@ -187,7 +187,16 @@ export function isLoaded(name) {
return Boolean(xarc.getSubApp(name));
}

export function lazyLoadSubApp({ name, id, timeout = 15000, onLoad, onError, fallback, ns, props }) {
export function lazyLoadSubApp({
name,
id,
timeout = 15000,
onLoad,
onError,
fallback,
ns,
props
}) {
// TODO: timeout and callback
const lname = name.toLowerCase();

Expand Down

0 comments on commit 16ebc15

Please sign in to comment.