Our great sponsors
-
counter-app
This tiny application is like adding,removing,deleting, resetting products which reflects in the total number of products into our shopping cart. (by arnab-datta)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
rescript-core
A drop-in standard library for ReScript. Intended to be familiar for JavaScript developers, easy to use, and be rich enough (without being bloated) so that you don't need to reach for anything else for typical ReScript development.
-
rescript-counter-app
This tiny application is like adding,removing,deleting, resetting products which reflects in the total number of products into our shopping cart.
This simple counter app is one of the examples you can find in the React docs.
@rescript/react: ReScript bindings to React and support for JSX
ReScript is "Fast, Simple, Fully Typed JavaScript from the Future". Let's take a look at how we can add it to an existing React project.
@rescript/core: The ReScript standard library
Here's a PR for the initial setup: https://github.com/jderochervlk/rescript-counter-app/pull/1
This function uses window.location.reload() which is a DOM api. We don't currently have any DOM bindings installed and available for ReScript. Let's go ahead and install some bindings.
Related posts
- How does one write React apps in a purely functional style without making the entire codebase a mess?
- Tired of Typescript? Check out ReScript!
- JavaScript and Python have made me realise why strong typing is important
- TypeScript is 'not worth it' Svelte switches to JavaScript and JSDoc
- Learning functional oncepts - Which Language?