Skip to content

Commit

Permalink
CxxReactPackage: Make initHybrid static (#41681)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #41681

## Rationale

Make initHybrid static. So that the derived class can initialize the C++ part with constructor arguments.

**Note:** This diff just applies the fix from D51550623. into CxxReactPackage.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D51642219

fbshipit-source-id: 095e452e03848379288af960969789aa5e9c0542
  • Loading branch information
RSNara authored and facebook-github-bot committed Nov 29, 2023
1 parent bae5238 commit c0375b8
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ import com.facebook.soloader.SoLoader
@UnstableReactNativeAPI()
abstract class CxxReactPackage {

@DoNotStrip @Suppress("NoHungarianNotation") private var mHybridData: HybridData? = initHybrid()
@DoNotStrip @Suppress("NoHungarianNotation") private var mHybridData: HybridData?

protected abstract fun initHybrid(): HybridData

protected constructor() {
mHybridData = initHybrid()
protected constructor(hybridData: HybridData?) {
mHybridData = hybridData
}

companion object {
Expand Down

0 comments on commit c0375b8

Please sign in to comment.