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

IntelliJ hightlight error while using functional components #433

Open
AlexITC opened this issue Oct 26, 2020 · 7 comments
Open

IntelliJ hightlight error while using functional components #433

AlexITC opened this issue Oct 26, 2020 · 7 comments

Comments

@AlexITC
Copy link
Contributor

AlexITC commented Oct 26, 2020

It should be simple to reproduce the issue, just open the pwa project from IntelliJ, then, open the Main class, you should see errors on IntelliJ while they aren't:

Screenshot from 2020-10-25 21-06-25

@nadenf
Copy link
Contributor

nadenf commented Oct 29, 2020

@AlexITC .. What happens if you just use SharedItemApp(apis, appInfo) ?

@AlexITC
Copy link
Contributor Author

AlexITC commented Oct 29, 2020

Apologize, that was my intention, it has the same effect:
image

@nadenf
Copy link
Contributor

nadenf commented Oct 29, 2020

I am getting the same issue now with non-functional components. Weird.

@AlexITC .. Is it working for you with normal components. And you definitely see Slinky injector in the Scala preferences ?

@AlexITC
Copy link
Contributor Author

AlexITC commented Oct 31, 2020

I have a project using the non-functional components, and everything works as expected.

@dispalt
Copy link
Contributor

dispalt commented Nov 12, 2020

I know they changed to scala 2.13 in Intellij 2020.3.x so we'll probably need a different build against scala2.13 before upgrading

@evbo
Copy link

evbo commented Dec 14, 2020

on intellij 2020.3 (Build #IC-203.5981.155), using Scala 2.13.4 and also and I get same highlighting errors as reported by @AlexITC. Also, here's a new one that took me quite a while to resolve!:

import org.scalajs.dom.{Event, html}
import slinky.core.{SyntheticEvent}
import slinky.web.html.{input, onChange, value}

object TableColumnFilter {

  case class Props(column: ColumnFilter)

  val component = FunctionalComponent[Props] { props =>
    val count = props.column.preFilteredRows.length

    val onChangeValue = (e: SyntheticEvent[html.Input, Event]) => props.column.setFilter(e.target.value)

    // the commented line is what Intellij "wants" me to write, 
    // the uncommented line is correct and what compiles
    input(
      value := props.column.filterValue,
   // onChange := onChangeValue,
      onChange := (onChangeValue(_)),
      placeholder := s"Search ${count} records..."
    )
  }
}

@shadaj shadaj added this to the Backlog milestone Jan 30, 2022
@evbo
Copy link

evbo commented Mar 11, 2022

One more, formsubmission callbacks are syntactically correct but also get highlighted red erroneously:
VALD

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

No branches or pull requests

5 participants