Open tulusibrahim opened 2 months ago
the error is gone when i add loadAxios before the loadData. but it seems inefficient because it will load the script everytime?
Hi @tulusibrahim, could you please describe why you need to load some external library in actions?
The actions are not explicitly linked to each other, moreover all actions are executed asynchronously.
Hi, my goal is to use axios and some other lib. My step is:
load axios using require in loadAxios function
store it to global object e.store.formData.state (ex: e.store.formData.state.axios)![image](https://github.com/optimajet/formengine/assets/70683601/21ddc7d0-b23e-4068-bc67-05006375b983)
call loadAxios in form ondidmount![image](https://github.com/optimajet/formengine/assets/70683601/b0fe4ab4-9fcd-4b8b-b100-760796e6b5ec)
use axios on other function by simply call
let { axios } = e.store.formData.state
but when i call axios in an onLoadData event, it say axios is not defined even tough the load axios is called
![image](https://github.com/optimajet/formengine/assets/70683601/4de479bf-5d94-4b4f-a63b-69832dbe9f70)
same thing also happened to other lib
here is the reproducible issue: https://stackblitz.com/edit/vitejs-vite-kwyju8?file=package.json,src%2FApp.jsx,src%2Fbuilder.jsx%3AL7,src%2Fviewer.jsx
go to /viewer to get the error