surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
897 stars 372 forks source link

Named export 'SurveyCreatorComponent' not found. #5516

Closed skntrd closed 4 months ago

skntrd commented 4 months ago

Are you requesting a feature, reporting a bug or asking a question?

Reporting a issue

What is the current behavior?

Error : Named export 'SurveyCreatorComponent' not found.

What is the expected behavior?

Should created and rendered the survey creator

How would you reproduce the current behavior (if this is a bug)?

Provide the test code and the tested page URL (if applicable)

Tested page URL:

Test code

your_code_here

import { json } from "@remix-run/node";
import { useActionData, useLoaderData, useNavigation } from "@remix-run/react";
import {
  Page,
} from "@shopify/polaris";
import { authenticate } from "../shopify.server";
import "survey-core/defaultV2.min.css";
import "survey-creator-core/survey-creator-core.min.css";
import { SurveyCreatorComponent, SurveyCreator } from "survey-creator-react";

export const loader = async ({ request }) => {
  const { session } = await authenticate.admin(request);
  const { shop } = session;
  const creatorOptions = {
    showLogicTab: true,
    isAutoSave: true
  };

  return json({shop, creatorOptions});
};

export const action = async ({ request }) => {
  await authenticate.admin(request);
  return null;
};

export default function NewForm() {
  const nav = useNavigation();
  const actionData = useActionData();
  const loaderData = useLoaderData();
  const creator = new SurveyCreator(loaderData.creatorOptions);

  return (
    <Page title="Create New Form">
      <SurveyCreatorComponent creator={creator} />
    </Page>
  );
}

Specify your

JaneSjs commented 4 months ago

Hello @skntrd, Please refer to the following GitHub repository to learn how to integrate SurveyJS Creator within a Remix app: SurveyJS + Remix Quickstart Template.

Let us know if you have any questions or require further assistance.

Thanks