skevy / babel-preset-react-native-stage-0 Goto Github PK
View Code? Open in Web Editor NEWUse stage-0 Babel features with React Native
License: MIT License
Use stage-0 Babel features with React Native
License: MIT License
Hey @skevy
Thanks for this preset, and the taking the time to look at issues.
I just wanted to check if this plugin is compatible with the babelRelayPlugin. In my case using relay 0.9 and [email protected], I get Unexpected invocation at runtime
error for Relay.QL.
I also saw the your PR facebook/relay#714. For testing I put a console.log message before this line, and it doesn't run. However console.log just after line 56 works.
Clearing the watchman cache via watchman watch-del-all
and npm run start --reset cache
doesn't work as well.
My .babelrc looks like this
{
"passPerPreset": true,
"presets": [
{"plugins": ["./plugins/babelRelayPlugin"]},
"react-native-stage-0"
]
}
Someone on reactiflux suggested creating a rn-cli.config.js file, but that doesn't help as well.
Any ideas?
React 0.56.0 seems to break this.
Can't seem to get rid of this error no matter what I do. I've tried clearing the cache, deleting the watchman cache and I can't get past this.
Here is what my .bablerc
looks like
{
"presets": ["module:metro-react-native-babel-preset","react-native-stage-0/decorator-support","module:react-native-dotenv"]
}
I get the following error message when I try to run my app:
Element type is invalid: expected a string (for built-in components) or a class/function
(for composite components) but got: object.
Here is the relevant code:
/* index.android.js */
import { AppRegistry } from 'react-native'
import App from './app'
AppRegistry.registerComponent('Lifey', () => App)
/* app/index.js */
import React from 'react'
import { Root } from './config/router'
const App = () => <Root />
export default App
/* package.json */
{
"name": "Lifey",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"menu": "adb shell input keyevent KEYCODE_MENU"
},
"dependencies": {
"babel-preset-react-native-stage-0": "^1.0.1",
"prop-types": "^15.5.10",
"react": "16.0.0-alpha.12",
"react-native": "0.46.1",
"react-native-background-upload": "^3.0.0-beta",
"react-native-camera": "git+https://github.com/lwansbrough/react-native-camera.git",
"react-native-fs": "^2.3.3",
"react-native-video": "^1.0.0",
"react-navigation": "^1.0.0-beta.11"
},
"devDependencies": {
"babel-jest": "20.0.3",
"babel-preset-react-native": "1.9.2",
"jest": "20.0.4",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
}
I've tried having babel-preset-react-native-stage-0
under devDependencies
instead of dependencies
with the same result.
Everything works in I change the line that says import App from './app'
in index.android.js
to import App from './app/index'
, but it should be working without having to include index in the import, which is why I'm confused.
I've done the suggestions in the readme, e.g. resetting the cache. This used to work beautifully, but now not all, and of course my app doesn't work.
This errors is launched after update react-native to v0.57.0
Plugin/Preset files are not allowed to export objects, only functions. In /Users/danny/native/lqn-finder/node_modules/babel-preset-react-native-stage-0/index.js
Some idea? Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.