Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open Feliz.Plotly overwrites built-in "box" function #25

Open
mfrawley opened this issue Apr 27, 2021 · 3 comments
Open

open Feliz.Plotly overwrites built-in "box" function #25

mfrawley opened this issue Apr 27, 2021 · 3 comments

Comments

@mfrawley
Copy link

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

  1. Open Feliz.Plotly
  2. Try something like React.useEffect(loadData >> Async.StartImmediate, [| (box state.startDate) |])

Expected behavior

Opening a library should probably overwrite any core language functions.

@mfrawley
Copy link
Author

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.

@Shmew
Copy link
Owner

Shmew commented May 1, 2021

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.

@fahrenq
Copy link

fahrenq commented Oct 21, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants