Closed Montana closed 3 years ago
It seems like you are using a rather old version of Fable.React
, what version of Fable itself are you using?
It became a bit easier to create a function component in Fable 3.
Hey @nojaf,
This was the spot on answer. I've set up CRON
jobs to update specific libraries, and I happened to not put Fable.React
in there, I was using Fable 2.0
after running a version check.
I have now retried what I was trying to accomplish, and much easier. Thank you so much!
I am trying to write a simple React component using Fable. It should take display a simple counter with
+
and-
buttons. It also takes a messagestring
viaprops
. All my dispatchers are working.What is unexpected is that the code compiles, but it throws a run-time error:
Here is the code:
My
paket.lock
:Note: I want to use
setState
(rather than hooks or Elmish) for a variety of different reasons, and I've seen this similar problem elsewhere.In my
render
function, you need to useofType
like so:This get things to render, but nothing happens when you click on the buttons. So to try and fix this, I changed my
state
from anint
to anobject
, and still get a runtime error.