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

Refactoring with scalajs-react #145

Open
mdelem opened this issue Mar 13, 2016 · 2 comments
Open

Refactoring with scalajs-react #145

mdelem opened this issue Mar 13, 2016 · 2 comments

Comments

@mdelem
Copy link

mdelem commented Mar 13, 2016

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!

@kiritsuku
Copy link
Member

Which organize imports strategy do you have selected in Window > Preferences > Scala > Editor > Organize Imports?

@mdelem
Copy link
Author

mdelem commented Mar 13, 2016

It was "One import statement per importee".

I switched to "Preserve only wildcards". Works fine.

I didn't know about these options. Thanks!

Martin Delemotte

On Sun, Mar 13, 2016 at 2:05 PM, Simon Schäfer [email protected]
wrote:

Which organize imports strategy do you have selected in Window >
Preferences > Scala > Editor > Organize Imports?


Reply to this email directly or view it on GitHub
#145 (comment)
.

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

No branches or pull requests

2 participants