I am using react-native-sass-transformer package with React Native, and I cannot get past the following error:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Check the render method of `App`.
This error is located at:
in RCTView (created by View)
in View (created by ScrollView)
in RCTScrollView (created by ScrollView)
in ScrollView (created by ScrollView)
in ScrollView (created by App)
in App (created by ExpoRoot)
in ExpoRoot
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
at node_modulesreact-nativeLibrariesLogBoxLogBox.js:149:8 in registerError
at node_modulesreact-nativeLibrariesLogBoxLogBox.js:60:8 in errorImpl
at node_modulesreact-nativeLibrariesLogBoxLogBox.js:34:4 in console.error
at node_modulesexpobuildenvironmentreact-native-logs.fx.js:27:4 in error
at node_modulesreact-nativeLibrariesCoreExceptionsManager.js:104:6 in reportException
at node_modulesreact-nativeLibrariesCoreExceptionsManager.js:172:19 in handleException
at node_modulesreact-nativeLibrariesCoreReactFiberErrorDialog.js:43:2 in showErrorDialog
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:15792:34 in logCapturedError
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:15884:20 in update.callback
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:7199:2 in callCallback
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:7220:20 in commitUpdateQueue
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:16632:25 in commitLifeCycles
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:19216:22 in commitLayoutEffects
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:93:4 in invokeGuardedCallbackProd
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:318:2 in invokeGuardedCallback
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:18952:29 in commitRootImpl
at node_modulesschedulercjsscheduler.development.js:468:23 in unstable_runWithPriority
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:18791:17 in commitRoot
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:18192:12 in performSyncWorkOnRoot
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:5911:33 in runWithPriority$argument_1
at node_modulesschedulercjsscheduler.development.js:468:23 in unstable_runWithPriority
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:5906:23 in flushSyncCallbackQueueImpl
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:5893:28 in flushSyncCallbackQueue
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:17745:30 in scheduleUpdateOnFiber
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:21484:23 in updateContainer
at node_modulesreact-nativeLibrariesRendererimplementationsReactNativeRenderer-dev.js:22144:17 in render
at node_modulesreact-nativeLibrariesReactNativerenderApplication.js:58:4 in renderApplication
at node_modulesreact-nativeLibrariesReactNativeAppRegistry.js:117:25 in runnables.appKey.run
at node_modulesreact-nativeLibrariesReactNativeAppRegistry.js:202:4 in runApplication
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:414:4 in __callFunction
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:113:6 in __guard$argument_0
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:365:10 in __guard
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:112:4 in callFunctionReturnFlushedQueue
I have added the code inside metro.config.js
and app.json
as specified here.
My code inside App.js
:
import { ScrollView, StyleSheet } from 'react-native';
import LoginPage from './src/Components/Pages/LoginPage/LoginPage';
export default function App() {
return (
<ScrollView style={styles.container}>
<LoginPage />
</ScrollView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1
}
});
LoginPage.jsx
:
import { View } from 'react-native';
const LoginPage = () => {
return (
<View></View>
);
};
export default LoginPage;
Even if I revert the changes made for react-native-sass-transformer, the error persists. I do not have any idea of what to try.