Why do `.resi` and `.res` files require defining records twice (once in each...
I like pub myself, but since rescript targets javascript ecosystem I think the choice should be for export
View ArticleWhat would belong in a `.gitignore` template for ReScript?
jderochervlk: The output from create rescript app has this Thanks for the extra details! Since ran the command updating an existing JS code base it must have left the entries that I already had where...
View ArticleWhat would belong in a `.gitignore` template for ReScript?
I opened Create ReScript.gitignore by brettcannon · Pull Request #4449 · github/gitignore · GitHub .
View ArticleHow to use Custom Components as Props in rescript
I’m working with react-multi-carousel where i need to pass customDot in jsx it is written like below but I not sure how to do this in rescript const CustomDot = ({ onMove, index, onClick, active })...
View ArticleHow to use Custom Components as Props in rescript
Well the prop should just be typed as a React.element I guess then.
View ArticleHow to use Custom Components as Props in rescript
Like Paul is saying, if you’re putting the CustomDot in brackets as you are passing it into Carousel, you are doing the rendering of that component into React.element. You don’t pass the props to...
View ArticleHow to use Custom Components as Props in rescript
codeWarrior: { onMove, index, onClick, active } @tsnobip @mouton thanks for replying I tried doing what @mouton suggest, my current code - module Carousel = { @module("react-multi-carousel")...
View ArticleHow to use Custom Components as Props in rescript
What worked for me is let defaultDotProps = { onMove: _ => (), index: 0, carouselState: defaultStateCallBack, onClick: _ => (), active: false, } module CustomDots = { type...
View ArticleHow to use Custom Components as Props in rescript
For generic components, I like to use the first class module type : It allows to enforce styling rules based on component props. // Button.res module type Icon = { @react.component let make: (~size:...
View ArticlePromise of result--why or why not?
Hi folks, I have a related question about all this. I’m currently in a Node.JS backend function. A lot of things can go wrong in my request handler. Some of these things I know upfront, so I tried to...
View ArticleOutput of the code run in the Playground
Hi everyone! We’ve recently added the ability to run the code that you wrote in the Playground and to display the logs generated by your code inside a “Console” tab. Displaying the console logs in the...
View ArticleOutput of the code run in the Playground
Keep in mind that in the future we will have another (half?) tab for genType output as well. One other thought I just had was that if we have that many tabs they should all have their dedicated icon...
View ArticleOutput of the code run in the Playground
tsnobip: Displaying the console logs in the playground require them to be stringified which sometimes leads to weird results (eg for undefined, functions, errors, etc), so another solution would be to...
View Article[Article] ReScript has come a long way, maybe it's time to switch from...
I poured through the corners of the internet to find past pain points found in ReScript and wrote down how many of these things are now solved or changed for the better! It really is incredible how...
View ArticlePromise of result--why or why not?
Hot take, but I have had success with using a polymorphic variant for the error type, it allows you to accumulate a wide range of possible errors as your promise value winds its way up the stack. We...
View ArticlePromise of result--why or why not?
Mind posting a (somewhat elaborate) example of this? I think that might be helpful.
View Article[ANN] ReScript Retreat Roadmap Summary 2024
Hello everyone! As you may already know, we had our ReScript Retreat 2024 event from 22-25th of May in Vienna to work together in person and sync up on our processes. There we discussed our goals and...
View ArticlePromise of result--why or why not?
I built a small library which I’m using in many of my projects: GitHub - dkirchhof/rescript-async-result It’s just a wrapper for a promise<result<'a, 'b>> type
View Article#value is not allowed in type parameter
This code is failing compilation. type a<'a> = A let strVar: a<string> = A let intVar: a<int> = A type customType = [#customTag] let customVar: a<#customTag> = A Is this is a...
View Article