Skip to content

Commit

Permalink
Merge pull request #1090 from japgolly/lazy-reuse-component
Browse files Browse the repository at this point in the history
Make reuse component lazy
  • Loading branch information
rpiaggio authored Feb 2, 2024
2 parents 3c0f6fa + 5c59b93 commit 1b98dcb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- v*.*.*

jobs:

ci:
runs-on: ubuntu-latest
strategy:
Expand All @@ -18,7 +17,6 @@ jobs:
scala: 3
name: Scala v${{ matrix.scala }} / Java v${{ matrix.java }}
steps:

- name: Git checkout
uses: actions/checkout@v4
with:
Expand All @@ -37,7 +35,6 @@ jobs:
needs: ci
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand All @@ -46,7 +43,7 @@ jobs:
uses: japgolly/[email protected]

- name: Release
run: cd library && sbt ci-release
run: cd library && sbt -v -J-Xmx6g ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ object CustomHook {
Reusability( (a, b) => a.reusability.test(a.value, b.value) )

// Component for reuse. Must be stable.
private val ReuseComponent = React.memo(ScalaFnComponent[ReuseComponentProps[Any]](_.renderVdom))
private lazy val ReuseComponent = React.memo(ScalaFnComponent[ReuseComponentProps[Any]](_.renderVdom))

def shouldComponentUpdate[D](render: D => VdomNode)(implicit r: Reusability[D]): CustomHook[() => D, VdomNode] = {
CustomHook[() => D]
Expand Down

0 comments on commit 1b98dcb

Please sign in to comment.