react-view icon indicating copy to clipboard operation
react-view copied to clipboard

Make propHook.what accept a function

Open tajo opened this issue 5 years ago • 3 comments

Today, it's always a string and needs to be an expression. That can get unreadable for some more complex cases.

Explore adding an option to pass a function and stringify it with fn.toString().

tajo avatar Dec 17 '19 18:12 tajo

Do you have any pointers for this one? Would love to give it a shot. I assume something needs to be done here:

https://github.com/uber/react-view/blob/master/src/ast.ts#L52

raunofreiberg avatar Feb 04 '20 15:02 raunofreiberg

Yea, that should be the place. You need to check if what is a function and if so, it needs to be stringified and parsed.

tajo avatar Feb 04 '20 18:02 tajo

Any updates on this? @raunofreiberg

parssak avatar Jan 02 '23 22:01 parssak