React Native Android Syntaxerror: Attempted To Redefine Property 'key'
Solution 1:
The problem was: key
was defined twice in a view somewhere, i.e. something like
<Viewkey={index}key={other}... />
So just remove one of the key
properties.
Intermediate step to find the solution:
At first, when pressing Start Chrome Debugging
in the React Native Menu, the app will run again, but the error will be shown in the console of the corresponding browser tab.
Then it shows a bit better error message.
Strangely this error doesn't occur on iOS.
Solution 2:
I had the same error but with a different keyword
In my case the keyword was declared twice in my css styles properties.
let styles = StyleSheet.create({
keyword:{},
keyword:{}
});
No crash or warning on iOS but causing a crash on Android.
Solution 3:
Encountered the same error on v0.49. Spent a lot of time and finally found that there are duplicates in my css declaration:
logo: {
flex:.3,
height: 120,
marginBottom: 10,
},
logo: {
...styText,
marginTop: 10
},
just removed the second declaration fixed the error.
Post a Comment for "React Native Android Syntaxerror: Attempted To Redefine Property 'key'"