Skip to content

Instantly share code, notes, and snippets.

@EmperorEarth
Created September 27, 2017 18:50
Show Gist options
  • Select an option

  • Save EmperorEarth/5b7ab163687cc3a5b3dfd24547edd821 to your computer and use it in GitHub Desktop.

Select an option

Save EmperorEarth/5b7ab163687cc3a5b3dfd24547edd821 to your computer and use it in GitHub Desktop.
We've found a bug for you!
C:\code\src\git.cheung.nyc\kevin\firstRE\re\app.re
7 Γöå <Text style=Style.(style [color "#000"]) value="hello world" />
8 Γöå <Text style=Style.(style [color "#000"]) value=(string_of_int 10) />
9 Γöå <Test />
10 Γöå <Greeting name="John" />
11 Γöå </View>;
This is:
name::'a =>
ReasonReact.componentSpec
int int ReasonReact.noRetainedProps ReasonReact.noRetainedProps
Test.action
But somewhere wanted:
ReasonReact.component 'b 'c 'd (defined as
ReasonReact.componentSpec 'b 'b 'c 'c 'd)
open ReactNative;
let app () =>
<View>
<Test />
</View>;
open ReactNative;
type action =
| Press;
let component = ReasonReact.reducerComponent "Test";
let make ::name _children => {
...component,
initialState: fun () => 0,
reducer: fun action state =>
switch action {
| Press => ReasonReact.Update (state + 1)
},
render: fun self =>
<Button
onPress=(self.reduce (fun _event => Press))
title={j|Hello. You've clicked the button $self.state times(s)!|j}
/*style=Style.(style [color "#000"])*/
/>
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment