Skip to content

Unable to set error on whole proxied object. #219

@AlexShukel

Description

@AlexShukel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions