Hi, guys!
First of all, thanks for your amazing work with code-push, it's awesome! 😉
Description
After finishing codePush setup process, I've started to see a warning like:
Warning: Stateless function components cannot be given refs
(See ref "rootComponent" in App created by CodePushComponent).
Attempts to access this ref will fail.
Reproduction
Currently, I have a setup file which is responsible for defining the main component, which is just like:
setup.js
// ...
let App = () => (
<Provider store={store}>
<StyleProvider style={theme}>
<RouterWithRedux scenes={scenes} />
</StyleProvider>
</Provider>
);
module.exports = codePush(App);
index.ios.js / index.android.js
import {AppRegistry} from 'react-native';
const App = require('./config/setup');
AppRegistry.registerComponent('MyApp', () => App);
Except for a ref used on a TextInput, defined on a component with state, I do not use any other refs. Removing codepush() makes this warning disappear.
Additional Information
- react-native-code-push version: 1.17.2-beta
- react-native version: 0.42.0
- iOS/Android/Windows version: iOS 10.2
- Does this reproduce on a debug build or release build? Debug
- Does this reproduce on a simulator, or only on a physical device? Both