Skip to content

Commit c2b5697

Browse files
committed
fix(SearchInputBar): 处理用例报错
1 parent 489a29e commit c2b5697

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

example/examples/src/routes/SearchInputBar/index.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export interface IndexState {
1515

1616
export default class Index extends Component<IndexProps, IndexState> {
1717
static state: IndexState;
18-
ref = React.createRef<SearchInputBar>();
1918
constructor(props: IndexProps) {
2019
super(props);
2120
this.state = {
@@ -38,12 +37,9 @@ export default class Index extends Component<IndexProps, IndexState> {
3837
<Container keyboardShouldPersistTaps="always">
3938
<Layout>
4039
<Header title={title} description={description} />
41-
<Body
42-
keyboardShouldPersistTaps="always"
43-
style={{paddingHorizontal: 10}}>
40+
<Body keyboardShouldPersistTaps="always" style={{paddingHorizontal: 10}}>
4441
<View style={styles.divider} />
4542
<SearchInputBar
46-
ref={this.ref}
4743
onChangeText={val => this.onChangeText(val, 'value')}
4844
onClear={() => this.onClear('value')}
4945
placeholder="请输入搜索关键字..."
@@ -58,7 +54,6 @@ export default class Index extends Component<IndexProps, IndexState> {
5854
}}
5955
touchProps={{
6056
onPress: () => {
61-
console.log('object', this.ref);
6257
this.setState({loading: true}, () => {
6358
setTimeout(() => {
6459
this.setState({loading: false});

test-ci/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"prop-types": "15.7.2",
4242
"react-native-gesture-handler": "2.8.0",
4343
"react-native-root-siblings": "4.1.1",
44-
"react-native-svg": "12.1.1"
44+
"react-native-svg": "12.1.1",
45+
"@shopify/restyle":"~2.4.2"
4546
},
4647
"jest": {
4748
"setupFiles": [

0 commit comments

Comments
 (0)