react
react copied to clipboard
fix: prevent double loading spinners
When using a recent version of this library and @formio/js, two loading spinners were displayed for a single form. This was caused by both libraries showing their loading indicators simultaneously.
This PR fixes the issue by:
- Adding a default template configuration that sets a single loading indicator
- Initializing the template on library import to ensure it's set before Form components render
The solution:
- Created a new
templates.tsfile that sets up the default template configuration - The template is initialized when the library is imported, ensuring consistent loading indicator behavior
- Uses bootstrap3 framework for compatibility
To test:
- Import the Form component from @formio/react
- Create a form with a remote source like:
<Form src="https://examples.form.io/example" /> - Observe that only one loading spinner appears while the form loads
Fixes #590