-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
While trying to bring in an audio plotter library, I noticed that when I ask for one instance of my view to be rendered, two are instantiated.
Fearing that I'm doing something wrong, I started to dig deeper and created a test project where I duplicated the tic-tac-toe project and rendered a single scroll view, modified the RCTCustomScrollView class accordingly:
@implementation RCTCustomScrollView
- (instancetype)initWithFrame:(CGRect)frame
{
NSLog(@"%@ %@()", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
if ((self = [super initWithFrame:frame])) {
[self.panGestureRecognizer addTarget:self action:@selector(handleCustomPan:)];
}
return self;
}
Implemented via:
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
ScrollView,
} = React;
var TicTacToeApp = React.createClass({
render() {
return (
<ScrollView style={styles.container}>
<Text style={styles.title}>Test View</Text>
</ScrollView>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white'
},
title: {
fontFamily: 'Chalkduster',
fontSize: 39,
marginBottom: 20,
}
});
AppRegistry.registerComponent('TicTacToeApp', () => TicTacToeApp);
module.exports = TicTacToeApp;
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.