Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

standaloneOptions customProps not working for standalone app. #24

Open
DamianPereira opened this issue Nov 4, 2022 · 0 comments
Open

Comments

@DamianPereira
Copy link

DamianPereira commented Nov 4, 2022

Hi! I have this configuration in my webpack.config.js, these are 2 new root and microfrontend app created with create-single-spa 4.1.2

  const defaultConfig = singleSpaDefaults({
    orgName: "someOrg",
    projectName: "mf1",
    webpackConfigEnv,
    argv,
    standaloneOptions: {
      customProps: {
        testing: true,
      },
    },
  });

And this in my main app js file

const lifecycles = singleSpaReact({
  React,
  ReactDOM,
  loadRootComponent: (args) => {
    console.log(args.testing);
      return Promise.resolve(Root);
    }
  },
  errorBoundary(err, info, props) {
    // Customize the root error boundary for your microfrontend here.
    return null;
  },
});

The testing customProp does not reach the args inside loadRootComponent when using the standalone mode. But if I do this in root-config for embedded mode, then it works:

registerApplication({
  name: "someOrg/mf1",
  app: () => System.import("someOrg/mf1"),
  activeWhen: ["/"],
  customProps: {
    testing: true
  },
});

How can I send custom props to the standAlone app only?

@filoxo filoxo transferred this issue from single-spa/single-spa-react Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant