Exports for use-form-api and use-field-api #1164
Replies: 3 comments 2 replies
-
@steverhoades Hi. The functions are exported and working as you can see here: https://codesandbox.io/s/stoic-feather-ywved?file=/src/App.js. You should not be required to use direct imports (although it's recommended). I was looking at the build files to see if we didn't omit these functions from the main entry file and it is there. However, the main TS declarations file seems to be exporting only the functions interfaces, but not the functions themselves. Do you happen to use typescript? And is it possible to see the micro app code before the changes? It would help me to debug the issue even further. |
Beta Was this translation helpful? Give feedback.
-
I am indeed using Typescript! Perhaps it isn't an actual issue of using the import but one reported by my IDE due to the missing declaration. Unfortunately the micro-app project is private and I am unable to share. Is there something in particular that you have questions about, I can do my best to add whatever detail I can. |
Beta Was this translation helpful? Give feedback.
-
Here is a fix: #1166 |
Beta Was this translation helpful? Give feedback.
-
I'm curious if it was a design choice to not have these available from the base package.
e.g. I must explicitly import this from
@data-driven-forms/react-form-renderer/use-form-api
or@data-driven-forms/react-form-renderer/use-field-api
respectively vs.import {useFieldAPi} from @data-driven-forms/react-form-renderer
.I only ask as I've spent the last hour or so debugging why my microapp wasn't playing nice with it's application shell. Turns out it was moving the dependencies from the microapp to the shell that broke as I didn't explicitly declare
use-form-api
anduse-field-api
as dependency externals.Beta Was this translation helpful? Give feedback.
All reactions