基本上,我正在寻找有用的react-bootstrap包装器。在审查我找到this github project的不同可能性时。我已经分叉它们并开始更新版本。但是在将scalajs-react版本从0.8.1更新到0.9.2后,我已经陷入了与html.Element vs dom.Element的混乱。
Affix object在范围
上调用getDOMNode()val domNode = scope.getDOMNode()
早期的domNode是扩展type TopNode = html.Element
但是在最新版本的domNode扩展type TopNode = dom.Element
中没有诸如'className','offsetHeight'和'style'之类的值。所以我得到编译失败
[error] /Users/vl/dev/git/scalajs-react-bootstrap/core/src/main/scala/com/acework/js/components/bootstrap/Affix.scala:94: value offsetHeight is not a member of japgolly.scalajs.react.TopNode
[error] } else if (offsetBottom.isDefined && (position.top + domNode.offsetHeight >= scrollHeight - offsetBottom.get)) {
[error] ^
[error] /Users/vl/dev/git/scalajs-react-bootstrap/core/src/main/scala/com/acework/js/components/bootstrap/Affix.scala:102: value style is not a member of japgolly.scalajs.react.TopNode
[error] domNode.style.top = ""
[error] ^
[error] /Users/vl/dev/git/scalajs-react-bootstrap/core/src/main/scala/com/acework/js/components/bootstrap/Affix.scala:53: value className is not a member of japgolly.scalajs.react.TopNode
[error] var className = affixRegexp.replaceAllIn(node.className, "")
[error] ^
如何在最新的scalajs-react版本中管理它? (据我所知,这个功能被转移到单独的项目'scalajs-dom')
答案 0 :(得分:0)
有用的导入是
import japgolly.scalajs.react.extra.DefaultReusabilityOverlay.autoLiftHtml