@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 createApplicationFunctions(renderFn) {
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
- }, renderFn(props))
35
+ }, React.createElement(Comp, {
36
+ ...props
37
+ }))
36
38
  });
37
39
  }
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './Parcel';
2
2
  export { createParcelFunction } from './createParcelFunction';
3
- export { createApplicationFunctions } from './createApplicationFunctions';
3
+ export { createApplicationFunction } from './createApplicationFunction';
package/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './Parcel';
2
2
  export { createParcelFunction } from './createParcelFunction';
3
- export { createApplicationFunctions } from './createApplicationFunctions';
3
+ export { createApplicationFunction } from './createApplicationFunction';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/single-spa",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "React component for build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -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>;