improve plugin implementation: update method signatures, consolidate event emitter, and regenerate dependencies
This commit is contained in:
parent
a588e93657
commit
0b77bf0abd
@ -7,9 +7,12 @@ import com.facebook.react.uimanager.ViewManager
|
||||
|
||||
|
||||
class WebIdMetaPluginPackage : ReactPackage {
|
||||
override fun createNativeModules(reactContext: ReactApplicationContext)
|
||||
= listOf(WebIdMetaPluginModule(reactContext))
|
||||
|
||||
override fun createViewManagers(reactContext: ReactApplicationContext)
|
||||
= emptyList<ViewManager<*, *>>()
|
||||
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
||||
return listOf(WebIdMetaPluginModule(reactContext))
|
||||
}
|
||||
|
||||
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
||||
return emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ import com.facebook.react.ReactActivity
|
||||
import com.facebook.react.ReactActivityDelegate
|
||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
||||
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
||||
|
||||
class MainActivity : ReactActivity() {
|
||||
|
||||
@ -19,5 +18,5 @@ class MainActivity : ReactActivity() {
|
||||
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
||||
*/
|
||||
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
||||
DefaultReactActivityDelegate(this, mainComponentName, false)
|
||||
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
||||
}
|
||||
|
||||
@ -11,9 +11,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "19.2.3",
|
||||
"react-dom": "19.2.3",
|
||||
"react-native": "0.84.0",
|
||||
"react-native-web-id-meta-plugin": "file:.."
|
||||
"react-native-bouncy-checkbox": "^4.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
|
||||
@ -135,7 +135,9 @@
|
||||
"@react-native",
|
||||
"prettier"
|
||||
],
|
||||
"plugins": ["prettier"],
|
||||
"plugins": [
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"prettier/prettier": [
|
||||
|
||||
@ -17,9 +17,7 @@ const WebIdMetaPlugin = NativeModules.WebIdMetaPlugin
|
||||
}
|
||||
);
|
||||
|
||||
export const webIdEventEmitter = new NativeEventEmitter(
|
||||
Platform.OS === 'android' ? undefined : WebIdMetaPlugin
|
||||
);
|
||||
export const webIdEventEmitter = new NativeEventEmitter(WebIdMetaPlugin);
|
||||
|
||||
export function createMetaPlugin(
|
||||
uri: string,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user