Quantcast
Channel: ReScript Forum - Latest posts
Browsing all 1751 articles
Browse latest View live

[Question] Integrating InfernoJS

Hi, I have an existing project written with InfernoJS and terrible javascript. I have previous experience with ReasonML, and ReScript looks like something I would enjoy much more than what I currently...

View Article


[Question] Integrating InfernoJS

With the most 11.1 release, there’s the ability to use a custom JSX library, which seems like a good place to start. Not quite sure how state would work, though, given that inferno seems to rely on...

View Article


How to bind this kind of function?

This works only when we use this instance alone, in your example, the response will be the same for each other methods (here is an example).

View Article

How to bind this kind of function?

Per the library docs, doesn’t calling ky return its own custom response type? Perhaps you’d need to model, that, too, e.g this playground.

View Article

Image may be NSFW.
Clik here to view.

How to bind this kind of function?

Yes, I omit this part in my example to keep it basic. I made pretty much all the bindings except this last one I need for a specific use case I’m working on. let kyInstance =...

View Article


Image may be NSFW.
Clik here to view.

How to bind this kind of function?

DCKT: let kyInstance = Ky.Instance.create({prefixUrl: "someBasePath"}) kyInstance("path", {method: "GET"}).json() kyInstance.get("path").json() This pattern is never going to look and feel very...

View Article

Image may be NSFW.
Clik here to view.

Oh no, we're toast because of PPX usage

Thanks for the help, everybody! I’m circling back here to say that we’ve upgraded Decco to support Rescript 11 now, and added support for the new record spreading syntax in types! GitHub Release...

View Article

Image may be NSFW.
Clik here to view.

How to bind this kind of function?

Yes I know, I wanted to match closely the JS API at first but I think I’ll move to a module way with a type t like in the previous comments. Thanks for your answers everyone

View Article


How to bind this kind of function?

If type t doesn’t need to reference itself (return itself in this case) then you could make it a function type directly and have both that and @send functions for the other methods. Then you’d get rid...

View Article


Escaping the word type

Hello, I’m trying to write some bindings for ReactMapGL and they use the word type a lot in props or properties of props. Example: type sourceData = { \"type": string, // Is this correct? geometry:...

View Article

Escaping the word type

It’ll probably be more ergonomic to use the @as annotation instead, which would let you use whatever name you wanted within rescript, e.g.: type sourceData = { @as("type") type_: string, geometry:...

View Article

Oh no, we're toast because of PPX usage

Impressive work! Quite a lot of intricate internal stuff to understand for this to work.

View Article

Image may be NSFW.
Clik here to view.

Oh no, we're toast because of PPX usage

Thank you! Somehow we felt our way through piece by piece

View Article


Image may be NSFW.
Clik here to view.

How to bind this kind of function?

Since this is something that comes up from time to time, you can also just add another binding to create that returns the instance typed as a function directly, that then return t when invoked:...

View Article

Escaping the word type

Thanks, how can I use this trick for the standard element?

View Article


Escaping the word type

Do you mean for example type=“button” for buttons? Just pass type_="button" as prop. It will be converted automatically.

View Article

Looking for a React.memo() Example

Did anyone ever find an answer to this?

View Article


Looking for a React.memo() Example

Looks like wrapping the make function definition in React.memo is indeed sufficient. For example, in the following code, changing the Input’s text will only rerender Counter if the first letter is...

View Article

Image may be NSFW.
Clik here to view.

Error compiling @rescript/core with Rescript 11

fham: explain @rescript/core @rescript/core@1.3.0 node_modules/@rescript/core @rescript/core@"^1.3.0" from the root project @rescript/core@1.3.0 ../rescript-auth0-react/node_modules/@rescript/core...

View Article

Oh no, we're toast because of PPX usage

Hey, I use GitHub - green-labs/ppx_spice: ReScript PPX which generates the JSON (de)serializers which is based on Decco, it’s pretty neat and maybe could save you some effort migrating

View Article
Browsing all 1751 articles
Browse latest View live