Closed nolife08021 closed 4 years ago
what version of react-native are you on?
what version of react-native are you on?
react-native: 0.59.8
that's it I believe. You can upgrade but it is really unnecessary. Try the following:
-export const { Constants } = UIManager.getViewManagerConfig(nativeViewName);
+export const { Constants } = UIManager[nativeViewName];
or even
-export const { Constants } = UIManager.getViewManagerConfig(nativeViewName);
+export const { Constants } = {};
that's it I believe. You can upgrade but it is really unnecessary. Try the following:
-export const { Constants } = UIManager.getViewManagerConfig(nativeViewName); +export const { Constants } = UIManager[nativeViewName];
or even
-export const { Constants } = UIManager.getViewManagerConfig(nativeViewName); +export const { Constants } = {};
Okay. I will try it.
ios has no constants exported. for now.
ios has no constants exported
my bad, that was a stupid question.
try this, it's better:
export const { Constants } = UIManager.getViewManagerConfig ? UIManager.getViewManagerConfig(nativeViewName) : UIManager[nativeViewName];
reinstall to version 3.4.5
ios has no constants exported
my bad, that was a stupid question.
Not at all. In future releaseד it will have
please reply that all is working, including #18
After I reinstall to version 3.4.5
The error becomes -> null is not an object (evaluating '_ref.Constant')
I am a bit puzzled. but it is not breaking so. reinstall 3.4.7
.
I am a bit puzzled. but it is not breaking so. reinstall
3.4.7
.
The error still remaining after reinstall to 3.4.7
null is not an object (evaluating '_ref.Constants)
run this, I want to check if it's null.
console.log(UIManager.getViewManagerConfig)
changing to this should work
export const { Constants } = UIManager.getViewManagerConfig(nativeViewName) || {};
make sure it does and I'll bump the version
After Changing it, I received this Invariant Violation: requireNativeComponent: "RNMathView" was not found in the UIManager.
Is it because I using the Expo?
line 13:
export const { Constants } = UIManager.getViewManagerConfig(nativeViewName)
Not able to comment it, because of line 121: MathViewWrapper.Constants = ControlledMathView.Constants = Constants;
But after I replace it with
export const { Constants } = UIManager.getViewManagerConfig(nativeViewName) || {};
It will show another error Invariant Violation: requireNativeComponent: "RNMathView" was not found in the UIManager.
**I'm not sure that it solved the Constants issue or not.
RN 0.59 doesn't do automatic linking. You need to link the package.
react-native link react-native-math-view
Is there any way that I can perform the linking in expo without using ejecting to ExpoKit?
Native modules aren't supported in expo.
You can render the fallback component which is based on react-native-svg
. This is likely to affect performance.
import MathViewFallback from 'react-native-math-view/src/fallback';
@noli
react-native link react-native-math-view
Is there any way that I can perform the linking in expo without using ejecting to ExpoKit?
Did you figure out a way to get it to work in an expo project without ejecting your project? If so, I would greatly appreciate your help. I am getting the same issue
If you are like me and ended up with 400 ts errors when importing this module in typescript then here is the solution:
create a types/index.d.ts
:
declare module 'react-native-math-view/src/fallback'
declare module 'react-native-math-view/src/android' {
export type MathViewProps = any
}
and in tsconfig.json
add a path in compilerOptions:
"paths": {
"react-native-math-view/src/fallback": ["types"],
"react-native-math-view/src/android": ["types"]
}
If you are like me and ended up with 400 ts errors when importing this module in typescript then here is the solution:
create a
types/index.d.ts
:declare module 'react-native-math-view/src/fallback' declare module 'react-native-math-view/src/android' { export type MathViewProps = any }
and in
tsconfig.json
add a path in compilerOptions:"paths": { "react-native-math-view/src/fallback": ["types"], "react-native-math-view/src/android": ["types"] }
Does this happen on Expo?
It's not because of expo, I'm getting it now too
ERROR Invariant Violation: requireNativeComponent: "RNMathView" was not found in the UIManager.
any solutions?
null is not an object (evaluating '_UIManager$getViewMan.Constant)
from line:13-> react-native-math-view/src/android/MathView.tsx
Platform: Android "react-native-math-view": "^3.4.3",