First start with this text-to-speech App resulting in this demo of this App
Then modify that javascript to use Speech recognition as described in this Mozilla docs.
You could create a pluggable widget or JavaScript action, based on a plugin.
For example: https://www.npmjs.com/package/react-native-sound-recorder