I recently started building a simple smartphone app using ReactNative+ Expo and I’m trying to show embedded tweets with capaj/react-tweet-embed: component that you supply tweet id and you’ll get a tweet embed back, nothing more (github.com))as a reference.
I have a very simple question: Are there any ways to use this library in smartphone apps with Expo?
I actually tried it with Expo snack with web(not smartphone), and the embedded tweets showed up fine. Please check the below link.
However, when I use Expo in a local environment and use the same code, I get an error. What I did is here.
Commands:
Expo init my-project
cd my-project
npm i react-tweet-embed
Edit App.js to the same code that is in snack. Lastly, run Expo start
.
Then, I get this error:
Invariant Violation: View config getter callback for component
div
must be a function (receivedundefined
). Make sure to start component names with a capital letter.This error is located at:
in div (created by r) in r (at App.js:8) in App (created by ExpoRoot) in ExpoRoot (at renderApplication.js:45) in RCTView (at View.js:34) in View (at AppContainer.js:106) in RCTView (at View.js:34) in View (at AppContainer.js:132) in AppContainer (at renderApplication.js:39)
at node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in registerError
at node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.error
at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19 in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError
at node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:9:32 in ErrorUtils.setGlobalHandler$argument_0
at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
at node_modules\regenerator-runtime\runtime.js:293:29 in invoke
at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
at node_modules\regenerator-runtime\runtime.js:154:27 in invoke
at node_modules\regenerator-runtime\runtime.js:164:18 in PromiseImpl.resolve.then$argument_0
at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue
at [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue
I’m pretty new to smartphone app. and ReactNative and only recently started to understand the difference between React and ReactNative.
I spent the whole day today looking for various ways to use this library, but I can’t find a solution at all. Please help me :,-(
P.S. I have a sneaking suspicion that the root cause of this is ReactNative’s support for views instead of div.