Comments (6)
The object you are passing is too big for stringifying it.
Same thing will probably occured if you do JSON.stringify yourClickEv
You should pass only the data you need.
When, you use a form input you pass:
OnInput (fun ev -> MyMsg ev.Value)
not:
OnInput (fun ev -> MyMsg ev)
from debugger.
@MangelMaxime Oh, I didn't know about that
@nojaf It's difficult to detect this kind of errors, I myself have been bitten by them several times. I think the main problem is we (by "we" I mean "I") started to use dynamic operators when dealing with React events (OnClick (fun ev -> ev.target?value |> doSomething)
) which makes it easy to just write ev?value
(or box in your case) and the compiler won't complain. We need to get used to write (ev.target :?> Browser.HTMLInputElement).value
or use extensions like the one Maxime pointed out.
from debugger.
I have helpers like these in my project, maybe we could add them to Fable.React to prevent these situations:
let inline onValueChanged f =
OnChange (fun ev -> (ev.target :?> Browser.HTMLInputElement).value |> f)
let inline onChecked f =
OnChange (fun ev -> (ev.target :?> Browser.HTMLInputElement).``checked`` |> f)
from debugger.
This might actually work w/o a debugger and tracing, but as @MangelMaxime said, for showing the debug info we serialize the messages and in case of the full event object it will drag the entire browser DOM along. Closing.
from debugger.
@alfonsogarciacaro Hum for the first one we already added ev.Value
for this specific case.
from debugger.
Could we not improve the error message? If you don't know this, it's hard to figure out...
from debugger.
Related Issues (20)
- Update to Fable 2 HOT 12
- Security issue with remotedev dependency HOT 8
- when replay from redux tools incorrect serialization of list HOT 7
- Array slicing not working with redux replay. HOT 14
- Influence Message / State formatting HOT 5
- Print an error message only once if the connexion failed ? HOT 2
- Breaking change in v2 related to non-F# objects? HOT 5
- Serialization issues HOT 3
- Please publish on nuget v3.0.0 HOT 2
- TypeError: Converting circular structure to JSON HOT 1
- Elmish debugger can't work with decimal HOT 6
- Can't use debugger on non JS application HOT 6
- ActionType via remotedev
- Allow shutdown of underlying Socket HOT 4
- Thoth.Json version range too wide HOT 8
- Chart of State is not correctly displayed in Redux Devtools HOT 3
- Update for Fable 4 HOT 2
- Allow specifying 'name' HOT 2
- How do you use the Elmish Debugger? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from debugger.