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

External Component Not Found. #156

Open
junaiddaud opened this issue May 16, 2024 · 1 comment
Open

External Component Not Found. #156

junaiddaud opened this issue May 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@junaiddaud
Copy link

I am trying to add a feature for downloading external components. For that I have added a button. And onClick event I am mutating the reka external components. The external component is created without problem. But when I try to add that component inside the editor it gives an error of Error: Component "ImageGallery" not found

Here is my onClick Function

  const handleDownload = () => {
    const neWComp = t.externalComponent({
      name: 'ImageGallery',
      render: () => {
        return <ImageGallery />;
      },
    });
    editor.reka.change(() => {
      const updatedComponents = {
        ...editor.reka.externals.components,
        ImageGallery: neWComp,
      };

      editor.reka.externals.components = {
        ...updatedComponents,
      };
    });
  };
@prevwong
Copy link
Owner

Extending externals after init is not currently supported at the moment

@prevwong prevwong added the enhancement New feature or request label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants