Questions tagged [reason-react]

ReasonReact is the official Reason + BuckleScript bindings for ReactJS

ReasonReact (GitHub) is a set of opinionated + bindings for , developed as an open-source project by Facebook.

90 questions
1
vote
0 answers

Getting error 'variant constructor can't be found' while compiling

I was trying out use a sortable list component (react-sortable-hoc) on a ReasonReact project. But I ran into an error which I was trying to figure out for couple of hours. Steps I followed: made the @bs binds for sortableContainer() and…
Jaison Justus
  • 2,753
  • 8
  • 47
  • 65
1
vote
1 answer

How to define reusable constants?

I have a Reason React component that looks like the following: /* MyComponent.re */ let make = _children => { ...component, reducer: (action, state) => { switch (action) { | KeyDown(key) => switch (key) { | 13 =>…
csb
  • 674
  • 5
  • 13
1
vote
1 answer

Is it possible to code Reason React on windows 8.1?

I'm in the unfortunate situation for the next few months of having to use a Windows 8.1 machine on web development. I'm currently interested in ReasonML and I'm using Visual Studio code. Reason React is what I'm interested in to be exact. It seems…
Steve Waters
  • 3,348
  • 9
  • 54
  • 94
1
vote
1 answer

Fetching data from API for ReasonReact app

I'm learning ReasonReact and I would like to fetch data from a API, that I'm going to use on my component. However, on the official website about Reason or ReasonReact there's nothing about this, neither I found something searching on Google. How…
Mateus Felipe
  • 1,071
  • 2
  • 19
  • 43
1
vote
1 answer

Unbound record field name in Reason Component

Borrowing just about all of Yawar's helpful answer, I have the following: $cat src/index.re let products = [| {name: "Football", price: 49.99}, {name: "Basebll", price: 1.99}, {name: "Poker", price:…
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384
1
vote
1 answer

Can't resolve ReasonReact.js in webpack

I'm trying to get ReasonML working with an existing React code base. I'm not using create-react-app. This is a hand-built project. For the most part, it looks like everything is set up fine. However, I'm getting an error when I try to run Webpack…
jsc
  • 13
  • 2
1
vote
1 answer

Passing React Component to Another Component?

I'm trying to define a ProductRow and ProductCategoryRow from Thinking in React. productRow.re let component = ReasonReact.statelessComponent("ProductRow"); let make = (~name, ~price, _children) => { ...component, render: (_self) => { …
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384
1
vote
1 answer

making sense of what appears to be putting a type into a function in ReasonML: a styling convention or a syntax sugar?

I'm trying to learn ReasonML and come across this line in the source of Reason React Hacker News (src/CommentList.re): type action = | Toggle(option(string)); where the next occurrence of action is as a parameter in the function…
Archy Will He 何魏奇
  • 9,589
  • 4
  • 34
  • 50
1
vote
2 answers

What is the idiomatic way to create styles for a Reason-React component that depend on props?

To learn reason and reason-react, I'm working on a simple “Things 2 Do” app (see source code on GitHub). I have a TodoItem component that should be rendered with strike-through style when the item has been completed. I try to solve this by creating…
Patrick Hund
  • 19,163
  • 11
  • 66
  • 95
1
vote
2 answers

How to defined component /binding when using React ref in Reasonml?

I am having issues integrating react-system-notification module in my app, having read the documentation about Reason React Ref I am not sure why the reference is not passed down the stack; a hint would be much appreciated. I keep getting the error…
user465374
  • 1,521
  • 4
  • 20
  • 39
1
vote
1 answer

Render multiple components based on data attributes

On ReasonReact, if I want to render a specific element on a HTML element by id I can use the built-in function renderToElementWithId(ReasonReact.reactElement, Dom.element), for example: ReactDOMRe.renderToElementWithId(,…
Mateus Felipe
  • 1,071
  • 2
  • 19
  • 43
1
vote
1 answer

Is it possible to use reduce in a callback function?

I have this simple component let component = ReasonReact.statelessComponent("Input"); let make = (~name, ~onChange, ~value, _children) => { ...component, render: (_self) =>
ThomasThiebaud
  • 11,331
  • 6
  • 54
  • 77
1
vote
2 answers

Graphql array response to ReasonReact

Trying to figure working with data in reason. I have this graphql query returning data a logging it. Question is how do I access the data in the following component. let component = ReasonReact.statelessComponent("Home"); let make = (_) => { …
armand
  • 693
  • 9
  • 29
0
votes
1 answer

Getting data from Rescript input fields

I have this code for two input fields and a button: I have this code at the end:
0
votes
0 answers

Rails 18n French: Special Characters appear when words with accent are being used

I added french translation using i18n gem. Most of the french words with accent characters get printed correctly but some of the words are behaving incorrectly. Sécurité gets printed instead of Sécurité. I tried to escape the accented characters…