Comments (4)
A better option here is probably the requestOptions
plugin, see a trivial example here: https://codesandbox.io/p/sandbox/http-request-plugin-example-forked-y3m9v2?file=%2Fsrc%2Findex.js%3A8%2C19
I think the problem you're running into here, though, is that, at the moment, the request plugins don't accept asynchronous functions and can't really handle promises, so your code is not going to run and may just break the javascript execution by just passing Promise objects where actual options and request objects are expected. Although I would be interested to support asynchronous request plugin methods, for now you'll have to load any data that is needed by the plugin before registering it.
I am going to rename this issue and send it up the chain.
from react.
Hi Brendan,
Thanks for the quick response.
Well, I didn't post all the different alternatives I tried to not get a very long post, but I also tried returning the options (or request/value) variable directly trying to keep synchronous nature of it and the issues was the same: when I have the requestOptions in place, the request is not triggered once I select Resource in Data Source Type.
So, not really only for async functions.
from react.
Cool, what would help here is if you could throw up a minimally reproducible example on a codesandbox or something similar so we can get to the bottom of it, I'm still not quite sure I'm following.
from react.
Hi Brendan,
Nevermind. I was creating the codesandbox to send you and realized that I was using options.header.append to add the header to the request, this way is raising the issue I was talking about (where requests are not fired/triggered).
Changing it to options.header['custom-header'] did the trick.
I saw somewhere else that the this property was an object (or was being handled as such) instead of an array. It didn't come to my head to check it or try as an array (maybe I need some rest).
Thanks for the help though.
from react.
Related Issues (20)
- Text Input Components is Not Supported Within Dialog Component Wrappers of bootstrap or material HOT 1
- Collapse does not work HOT 3
- Tailwind CSS integration with formio/react HOT 3
- <Form /> has runtime errors when `noDefault` is `true` HOT 1
- `readOnly` option change doesn't re-render the <Form /> editability status HOT 2
- How can I make reference to <Form /> from external javascript code ? HOT 1
- ReferenceError: navigator is not defined in Nextjs HOT 2
- importScript Error while Drag and Drap New Text field HOT 7
- Bug: Component Style Not Applied Correctly
- adding custom component to formio . HOT 1
- React is null in @formio/react src/components HOT 1
- [BUG] Warning for Custom Components above React version 18 HOT 1
- "window is not defined" error in Next.js 14 HOT 4
- I am using FormBuilder in the react functional base component and am not able to re-render Formio Builder on state change.
- Using an external button and Hebrew name in API HOT 4
- Formio Builder configuration with accessibility HOT 3
- Address field does not pre-fill when passing data into submission object HOT 3
- Drop babel-polyfill
- Parse library for data collected by form?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.