Question:
I have a trouble with Typescript I am trying to infer the properties of an Object dynamically.take a look at the below code

as you can see Typescript can infer a global UI properties
but When I put the additional property in the Actions Object

Typescript doesn’t infer Object properties

How can I achieve it? please give any idea
Answer:
Your mapper function works as expected :fn
function which infers a union as a return type.
{ openModal: string } | { addDirectory: string }
in your example.So you need to explicit the return type with a generic :
If you have better answer, please add a comment about this, thank you!