These are chat archives for chandu0101/scalajs-react-components

13th
Mar 2018
Roberto Leibman
@rleibman
Mar 13 2018 15:43

@oyvindberg ... looking at SemanticUI, in the generator, I'm trying to do the generation for SuiDropdown and I'm getting an error, it generates something funny for the following code:

    /** Currently selected label in multi-select. */
    defaultSelectedLabel: customPropTypes.every([
      customPropTypes.demand(['multiple']),
      PropTypes.oneOfType([
        PropTypes.number,
        PropTypes.string,
      ]),
    ])

The error I see is:
defaultSelectedLabel: js.UndefOr[js.Any | js.Any | | Double | String]
I'm not sure how to tell it to just ignore the field.

Roberto Leibman
@rleibman
Mar 13 2018 15:55
I think that basically I want it to ignore types that for whatever reason come up empty.
Roberto Leibman
@rleibman
Mar 13 2018 17:23
ok, figured outwhere to filter out empty strings (and also duplicate types).
Roberto Leibman
@rleibman
Mar 13 2018 19:08
Also... looking at scalajs-react 1.2. Some of the things are easy, but the JsMacro is completely broken. @oyvindberg not so sure what to do about it.
core/target/scala-2.12/src_managed/main/chandu0101/scalajs/react/components/materialui/MuiAppBar.scala
[error]      type mismatch;
[error]       found   : japgolly.scalajs.react.raw.React.Node
[error]          (which expands to)  Unit | Null | Boolean | String | (Byte | Short | Int | Float | Double) | japgolly.scalajs.react.raw.React.Element | japgolly.scalajs.react.raw.recursiveTypeAliases.ChildrenArray[Unit | Null | Boolean | String | (Byte | Short | Int | Float | Double) | japgolly.scalajs.react.raw.React.Element]
[error]       required: scala.scalajs.js.Any
[error]      L73:    val props = JSMacro[MuiAppBar](this)