Describe the bug
When we use FormProxyProvider with useMappingProxy, the error for proxied path root can not be set. This happens because proxy tries to construct an object from mappings that were provided in ProxyMapSource, but it is impossible to construct an error for whole proxied object.
To Reproduce
https://codesandbox.io/s/reactive-forms-proxy-test-gtcqi2?file=/src/App.tsx
Expected behavior
Possible solution:
Create hook useFieldProxy with the same arguments as in useMappingProxy, but store whole object error internally in useRef. However, this approach has disadvantages, as we can not access that error from real values tree.
Describe the bug
When we use
FormProxyProviderwithuseMappingProxy, the error for proxied path root can not be set. This happens because proxy tries to construct an object from mappings that were provided inProxyMapSource, but it is impossible to construct an error for whole proxied object.To Reproduce
https://codesandbox.io/s/reactive-forms-proxy-test-gtcqi2?file=/src/App.tsx
Expected behavior
Possible solution:
Create hook
useFieldProxywith the same arguments as inuseMappingProxy, but store whole object error internally inuseRef. However, this approach has disadvantages, as we can not access that error from real values tree.