Modules as react props
I wonder if anyone else has had similar ideas. Composition and extension can be a bit tedious at times, especially for components with many prop fields. It can also be error prone to compose...
View ArticleRescriptRelay Query.use requires suspense wrapper
I was following RescriptRelay docs but ended up in a situation when I used Query.use on a component that is mounted after the initial render (for example when I push a new route and render a new...
View ArticleRescriptRelay Query.use requires suspense wrapper
Query.use always suspend unless all data is already there, because it’s a lazy query - it initiates the data fetching on mount. In Relay, using preloaded queries is best practice. Preloaded queries...
View ArticleRescriptRelay Query.use requires suspense wrapper
100% would recommend the Router. Really shows off what is possible when Rescript gets to stretch its legs I find myself missing many features when moving to other, TS centric routers. Way to kill it...
View Article[Article] ReScript has come a long way, maybe it's time to switch from...
Looking into ReScript over TypeScript to start a project, this is very helpful! Thanks
View ArticleTailwind CSS: adding `className` to components
well actually @react.component is just a shortcut that generates the props type and change the function from accepting labeled arguments to a props object, so doing it manually is not an issue at all!...
View ArticleAlright, what does the tilde do
When set on a parameter, what does it mean? I’ve looked …
View ArticleAlright, what does the tilde do
It’s a labeled parameter, here’s the doc about it ReScript Documentation Function | ReScript Language Manual Function syntax in ReScript
View ArticleAlright, what does the tilde do
thank you. It’s weird, I looked extensively and couldn’t find it. Searching the rescript site for ~ or tilde doesn’t turn up that doc.
View ArticleAlright, what does the tilde do
I’m having the same experience with |, which I know lets you do a switch-like operation, but I can’t get back to the docs that explain it, because I don’t know what it’s called.
View ArticleHow can i bind this?
const StorageManager = require("xyz"); const { Storage } = new StorageManager(config) Storage({ path: 'test' }) I have this code to bind, Storage() function can accept any object i have tried this...
View ArticleAlright, what does the tilde do
@fham we should add labeled args to the Syntax lookup so it’s easier to find.
View ArticleAlright, what does the tilde do
Docs about switch are here or were you talking about something else? ReScript Documentation Pattern Matching / Destructuring | ReScript Language Manual Pattern matching and destructuring complex data...
View ArticleHow can i bind this?
rafael-jurisoft: { redis: { prefix: "storage:file:", password: Env.redis_password, ip: Env.redis_ip, }, } Not sure I fully follow what you’re after, but here’s an example: module Storage = { // TODO:...
View ArticleCast unbox to primitive
Hello, I have variant type of strings: @unboxed type firestoreErrorCode = | @as("cancelled") Cancelled | @as("unknown") Unknown | @as("invalid-argument") InvalidArgument | @as("deadline-exceeded")...
View ArticleCast unbox to primitive
You almost had it: let e = React.string((code :> string)) :> is the coercion operator. It can coerce any variant that’s only represented by strings into a string (or to float, int etc, if that’s...
View ArticleCast unbox to primitive
Thank you! I have a related question about this. type collectionReference<'documentdata, 'metadata> type query<'documentdata, 'metadata> In OO terms the collectionReference inherits from...
View ArticleCast unbox to primitive
Probably not no, an identity cast like you have already seems more appropriate.
View Article