Skip to content
This repository was archived by the owner on Sep 3, 2020. It is now read-only.
This repository was archived by the owner on Sep 3, 2020. It is now read-only.

Refactoring with scalajs-react #145

Open
@mdelem

Description

@mdelem

Hi,

Using Scala Refactoring 0.9.1.2_11-201603041823 (Scala IDE 4.4.0-RC1) I get an error while trying to organize imports when using scalajs-react.

import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._

object Footer {

  val component = ReactComponentB.static("Footer",
    <.footer(^.textAlign.center,
    <.div(^.borderBottom := "1px solid grey", ^.padding := "0px"),
    <.p(^.paddingTop := "5px", "Humans, welcome!")
    )
  ).buildU

  def apply() = component()
}

Refactors to:

import japgolly.scalajs.react.ReactComponentB
import japgolly.scalajs.react.reactNodeInhabitableS
import japgolly.scalajs.react.vdom.prefix_<^.{ ^ => ^ }
import japgolly.scalajs.react.vdom.prefix_<^._react_autoRender
import japgolly.scalajs.react.vdom.prefix_<^._react_fragReactNode
import japgolly.scalajs.react.vdom.prefix_<^._react_styleString

object Footer {

  val component = ReactComponentB.static("Footer",
    <.footer(^.textAlign.center,
    <.div(^.borderBottom := "1px solid grey", ^.padding := "0px"),
    <.p(^.paddingTop := "5px", "Humans, welcome!")
    )
  ).buildU

  def apply() = component()
}

Thus generating an error (value < not found) on these lines:

<.footer(^.textAlign.center,
    <.div(^.borderBottom := "1px solid grey", ^.padding := "0px"),
    <.p(^.paddingTop := "5px", "Humans, welcome!")

Not sure this is fixable but I thought I'd let you know. Keep the good work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions