Skip to content

codegenNativeCommands parameter type limitations #54

Closed Answered by dmytrorykun
michbil asked this question in Q&A
Discussion options

You must be logged in to vote

The Command abstraction is a way to tell a native component to do something bypassing the renderer. You should not expect any return value from it. The return value from a command generally may depend on many things other than component itself. This makes such component non-composable. This breaks one of React's fundamental principles. This is also the reason why it only accepts primitive types. We may add some more capabilities in the future, but there are currently no plans for that.

It looks like the author is using the command as a substitute to a normal method call. I would recommend to try finding a way to implement this using Native Modules.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cortinico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants