Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find variable:Symbol #18932

Closed
bingfeng1225 opened this issue Apr 19, 2018 · 5 comments
Closed

Can't find variable:Symbol #18932

bingfeng1225 opened this issue Apr 19, 2018 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@bingfeng1225
Copy link

Environment

Environment:
OS: macOS High Sierra 10.13.4
Node: 9.11.0
Yarn: 1.5.1
npm: 5.8.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3

Steps to Reproduce

1、Create a new RN project with WebStorm
2、Define a Symbol in App.js
3、Select the Android platform to run
4、Code:
type Props = {}; const Test = Symbol('test'); export default class App extends Component<Props> { render() { return ( <View style={styles.container}> <Text style={styles.welcome}> Welcome to React Native! </Text> <Text style={styles.instructions}> To get started, edit App.js </Text> <Text style={styles.instructions}> {instructions} </Text> </View> ); } }

Actual Behavior

1、The following problems arise
screenshot_20180419-091248_hiasst

2、When selecting the "Debug JS Remotely" menu, the code works normally.

3、The code works well on the iOS platform。

@isnifer
Copy link
Contributor

isnifer commented Apr 21, 2018

@bingfeng1225

import 'es6-symbol/implement'

https://github.com/medikoo/es6-symbol

@bingfeng1225
Copy link
Author

@isnifer
Thanks for your help

@Zacqary
Copy link

Zacqary commented May 31, 2018

es6-symbol unfortunately isn't working in my project. Importing it results in a Objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner, _store}). If you meant to render a collection of children, use an array instead error. Same with babel-polyfill.

Is Symbol support in the Android runtime on the roadmap? That's the broader issue here, and the fact that a workaround (sometimes) exists doesn't mean this isn't an implementation gap.

@jkirkpatrick24
Copy link

@Zacqary did you come up with a solution? I'm having the exact same issue.

@acro5piano
Copy link

I import babel-polyfill instead of es6-symbol and it works.

@facebook facebook locked as resolved and limited conversation to collaborators May 11, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants