Feliz.Plotly
Feliz.Plotly copied to clipboard
open Feliz.Plotly overwrites built-in "box" function
Description
The "box" function exposed by Feliz.Plotly clobbers the built-in F# box function in F#. One needs it in order to box dependencies when using Feliz when creating stateful components. Opening this library makes the code much easier to read..Perhaps there is an easy resolution?
Steps to reproduce
- Open Feliz.Plotly
- Try something like
React.useEffect(loadData >> Async.StartImmediate, [| (box state.startDate) |])
Expected behavior
Opening a library should probably overwrite any core language functions.
I managed to find the namespace and using the fully qualified name for box it works i.e. Microsoft.FSharp.Core.Operators.box but needless to say this doesn't feel less hacky.
Hi @mfrawley,
Yeah I think I agree, I'll get the API modified to rename box
to box'
. In the meantime you can also do state.startDate :> obj
instead of boxing.
As a more elegant temporary fix, you can override box
back right after opening Feliz.Plotly
.
open Feliz.Plotly
// Feliz.Plotly shadows `box`: https://github.com/Shmew/Feliz.Plotly/issues/25
let box = Microsoft.FSharp.Core.Operators.box