Custom component fails after upgrading @formio/[email protected]

Open
#626 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
react, typescript

Research direction

Start by comparing the v5.x custom-component example with the current @formio/react 6.x integration and the existing vanilla JavaScript custom-component documentation. Document the supported React import and integration path, including how the example should be adapted for 6.x, so a React user can follow it without relying on vanilla JS assumptions.

Written by the indexing model from the issue text.

Description

Here is the initial code for the custom component under v5.x:

import { Formio } from '@formio/react';
const FieldComponent = Formio.Components.components.field;

After upgrading to 6.x, it fails with the console log:

Uncaught TypeError: Cannot read properties of undefined (reading 'Components') at SummaryInput.js:2:31

The IDE (Webstorm) also reports that it "cannot resolve symbol 'Formio'"

Where is the documentation that supports this? All documentation for custom components assumes vanilla JS, nothing about integration with React (or Angular, I suppose).

Dominant language
TypeScript
Stars
371
Forks
309
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from formio/react

All issues in formio/react

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.