fable-compiler / fable-react

Fable bindings and helpers for React and React Native
MIT License
275 stars 67 forks source link

open statements lead to react error #95

Open whitetigle opened 6 years ago

whitetigle commented 6 years ago

Hi, just stumbled on this problem:

this does not work

  open Fable.Recharts
  open Fable.Recharts.Props
  module SVG = Fable.Helpers.React.Props
  open Fable.Helpers.React

and leads to this error:

warning.js:33 Warning: React does not recognize the dataKey prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase datakey instead. If you accidentally passed it from a parent component, remove it from the DOM element.

meanwhile this works

  open Fable.Recharts
  open Fable.Recharts.Props
  module SVG = Fable.Helpers.React.Props
  // open Fable.Helpers.React

maybe something with modules loading?

whitetigle commented 6 years ago

BTW: Fable 1.3.17

alfonsogarciacaro commented 6 years ago

That's weird, Fable doesn't do anything for opening statements. Maybe the last opening is shadowing something from Recharts, does this work?

  open Fable.Helpers.React
  open Fable.Recharts
  open Fable.Recharts.Props
  module SVG = Fable.Helpers.React.Props
MangelMaxime commented 6 years ago

Seems like DataKey is defined only in recharts bindings. Perhaps you used it on an HTML element ?

swrhim commented 3 years ago

I ran into the same problem where ordering of the open statements was preventing my chart for recharts from being rendered with the same error message. Should this issue be referenced from this repo?

alfonsogarciacaro commented 3 years ago

Yes, that may be a good idea. Maybe opening an issue in fable-rcharts with a descriptive title that references this one. What Fable version are you using btw?

swrhim commented 3 years ago

Version 3. I'm using the latest SAFE template before .net 5 was announced. (not sure if that has something different)