@pushwoosh/single-spa 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
|
+
import { type ReactAppOrParcel } from 'single-spa-react';
|
|
3
|
+
import { type SPAContextType } from '@pushwoosh/spa-context';
|
|
4
|
+
export declare function createApplicationFunction<T extends {
|
|
5
|
+
spaContext: SPAContextType;
|
|
6
|
+
}>(Comp: ComponentType<T>): ReactAppOrParcel<T>;
|
|
@@ -26,12 +26,14 @@ class AppWrapper extends Component {
|
|
|
26
26
|
}, this.props.children);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
export function
|
|
29
|
+
export function createApplicationFunction(Comp) {
|
|
30
30
|
return singleSpaReact({
|
|
31
31
|
React,
|
|
32
32
|
ReactDOMClient,
|
|
33
33
|
rootComponent: props => React.createElement(AppWrapper, {
|
|
34
34
|
spaContext: props.spaContext
|
|
35
|
-
},
|
|
35
|
+
}, React.createElement(Comp, {
|
|
36
|
+
...props
|
|
37
|
+
}))
|
|
36
38
|
});
|
|
37
39
|
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type ReactElement } from 'react';
|
|
2
|
-
import { type ReactAppOrParcel } from 'single-spa-react';
|
|
3
|
-
import { type SPAContextType } from '@pushwoosh/spa-context';
|
|
4
|
-
export declare function createApplicationFunctions<T extends {
|
|
5
|
-
spaContext: SPAContextType;
|
|
6
|
-
}>(renderFn: (props: T) => ReactElement): ReactAppOrParcel<T>;
|