Sorry, could you clarify what you mean by "you didn't use the hook in the app"? I did use it here.
That's actually a very good question. Usually you need to pass unit () in the end if you have optional labeled arguments. If you don't enforce this, the compiler won't know whether you want to partially apply arguments to your function (=curried function, and maybe pass that optional argument later?) or you actually want to omit that argument and call the function right away.
I assume, since all components can optionally receive key as prop, you have to explicitly pass that unit to make sure it is going to be called and not partially applied. You can see here in the docs that reason component will generate makeProps like this:
Indeed you did. In your post you had it assigned to a function and looked for that in the code. You ended up using it directly in form onSubmit. github.com/MargaretKrutikova/pract...
Nice.
Optional key. Of course. I was wondering which of these props is optional. Tack, Madame. You are appreciated!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You didn't use the hook in the app after all that?!?!?
For other's who might want to actually use it, example, here
Great write up, @margaretkrutikova . Nice details and teaching. Since you dug into
makeProps
, why do we have to call it with a unit arg? As ininstead of which fails
Thanks again and keep it coming. Peace to you.
Sorry, could you clarify what you mean by "you didn't use the hook in the app"? I did use it here.
That's actually a very good question. Usually you need to pass unit
()
in the end if you have optional labeled arguments. If you don't enforce this, the compiler won't know whether you want to partially apply arguments to your function (=curried function, and maybe pass that optional argument later?) or you actually want to omit that argument and call the function right away.I assume, since all components can optionally receive
key
as prop, you have to explicitly pass that unit to make sure it is going to be called and not partially applied. You can see here in the docs thatreason
component will generatemakeProps
like this:So I think it will always have that optional argument
key
. I hope this makes sense!Indeed you did. In your post you had it assigned to a function and looked for that in the code. You ended up using it directly in form onSubmit. github.com/MargaretKrutikova/pract...
Nice.
Optional key. Of course. I was wondering which of these props is optional. Tack, Madame. You are appreciated!