ReasonML is based on the OCaml programming language and was created at Facebook, by the same creator as React! It shares a lot of features, but with the benefits of a statically typed functional programming language. ReasonML compiles to JavaScript and can therefore be used to create strongly typed React applications.
20. Strong Type System
We've found a bug for you!
my-react-app/src/Index.re 1:46
1 │ ReactDOMRe.renderToElementWithId(<Intro name=9 />, "intro");
This has type:
int
But somewhere wanted:
string
21. Strong Type System
We've found a bug for you!
my-react-app/src/Index.re 1:46
1 │ ReactDOMRe.renderToElementWithId(<Intro name=9 />, "intro");
This has type:
int
But somewhere wanted:
string
23. Strong Type System
We've found a bug for you!
my-react-app/src/Index.re 3:28-36
1 │ let intro = <Intro
2 │ name="React Amsterdam"
3 │ visitors={["Visitor","Visitor","Visitor"]}
4 │ />;
5 │
This has type:
string
But somewhere wanted:
ReactTemplate.Intro.visitor (defined as ReactTemplate.Intro.visitor)
24. Strong Type System
We've found a bug for you!
my-react-app/src/Index.re 3:28-36
1 │ let intro = <Intro
2 │ name="React Amsterdam"
3 │ visitors={["Visitor","Visitor","Visitor"]}
4 │ />;
5 │
This has type:
string
But somewhere wanted:
ReactTemplate.Intro.visitor (defined as ReactTemplate.Intro.visitor)
30. Statefull Component
We've found a bug for you!
my-react-app/src/Intro.re 2:17-53
1 │ /* Intro.re */
2 │ let component = ReasonReact.reducerComponent("Intro");
3 │
4 │ type visitor = {name: string, id: int};
This seems to be a ReasonReact reducerComponent? We don't have all the type
info for its state. Make sure you've done the following:
- Define the component `make` function
- Define `reducer` in that `make` body
- Annotate reducer's second parameter (state) with the desired state type
32. Statefull Component
We've found a bug for you!
my-react-app/src/Intro.re 5:18-24
3 │ /* State declaration */
4 │ type state = {
5 │ visitors: list(visitor)
6 │ };
7 │
This type constructor's parameter, `visitor`, can't be found. Is it a typo?
33. Statefull Component
We've found a bug for you!
my-react-app/src/Intro.re 5:18-24
3 │ /* State declaration */
4 │ type state = {
5 │ visitors: list(visitor)
6 │ };
7 │
This type constructor's parameter, `visitor`, can't be found. Is it a typo?