Skip to content

Conversation

@johnrazeur
Copy link

focus use the cache when we override the name with reflect

const form = useForm<{ name: string; otherName: string }>();
const lens = useLens({ control: form.control });
const reflect = lens.reflect((l) => ({ name: l.otherName }));

// Cache name
lens.focus('name');

console.log(reflect.focus('name').interop().name) // print name, should be otherName

When override, focus never use the cache, I don't know if the behavior is wanted.

@aspirisen
Copy link
Collaborator

@aspirisen
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants