You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting this error: Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
when I run the app.
I haven't been able to figure out what's going on. I did see SAFE-Stack/SAFE-Nightwatch#66 (comment) which had a similar problem, but (unless I'm misreading) that was fixed.
module App
open Elmish
open Elmish.React
open Elmish.ReactNative
open Fable.ReactNative
// A very simple app which increments a number when you press a button
type Model = { Counter: int }
type Message = | Increment
let init () = { Counter = 0 }, Cmd.none
let update msg model =
match msg with
| Increment ->
{ model with
Counter = model.Counter + 1 },
Cmd.none
module R = Fable.ReactNative.Helpers
module P = Fable.ReactNative.Props
open Fable.ReactNative.Props
let view model dispatch =
R.view [] [ R.text [] "Hi there" ]
Program.mkProgram init update view
|> Program.withConsoleTrace
|> Program.withReactNative "RNTestFSharp"
|> Program.run
index.js:
/**
* @format
*/
import { AppRegistry } from 'react-native';
import * as App from './out/App';
import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);
I'm getting this error:
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
when I run the app.
I haven't been able to figure out what's going on. I did see SAFE-Stack/SAFE-Nightwatch#66 (comment) which had a similar problem, but (unless I'm misreading) that was fixed.
Any help would be greatly appreciated!
I tried to follow https://github.com/martinmoec/fable-react-native-how-to as closely as I could.
Here are the steps I took:
App.fsproj:
App.fs:
index.js:
babel.config.js:
splitter.config.js:
package.json:
paket.lock:
metro.config.js:
The text was updated successfully, but these errors were encountered: