Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Missing form dataΒ #57

@stephanschubert

Description

@stephanschubert

πŸ› Bug report

Current Behavior

I took your Next.js example and tweaked it a little bit:

import { useAsync } from "react-use";
import { FormiumForm, defaultComponents } from "@formium/react";

import Spinner from "components/spinner";
import Error from "components/error";

import { formium } from "lib/formium";

const Form = ({ slug, preview = false }) => {
  const { loading, error, value: form } = useAsync(async () => {
    return formium.getFormBySlug(slug /* , previewData*/);
  }, [slug]);

  if (loading) {
    return <Spinner />;
  }

  if (error) {
    return <Error message={error.message} />;
  }

  console.log(form);

  ...

// other-component.js

<Form slug={"feedback"} />

But this outputs only {id: "603c6679edd5310001df6688"}.

Expected behavior

I expect the full JSON describing the form.

Additional context

It works when I use @formium/cli.

Your environment

Software Version(s)
Formium "@formium/client": "0.1.3" "@formium/react": "0.1.3"
React 17.0.1
TypeScript -
Browser Latest Chrome Canary
npm/Yarn npm 6.14.10
Operating System macOS 11.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions