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

[React Native] Grid 点击时不触发设定的函数 #755

Closed
Lxxyx opened this issue Jan 20, 2017 · 2 comments
Closed

[React Native] Grid 点击时不触发设定的函数 #755

Lxxyx opened this issue Jan 20, 2017 · 2 comments

Comments

@Lxxyx
Copy link
Contributor

Lxxyx commented Jan 20, 2017

本地环境

  • antd-mobile 版本:beta
  • 浏览器 (或标明是 react-native) 及其版本:0.40
  • 运行环境及其版本:

你做了什么?

引入Grid组件,设定onClick函数

  renderGrid = () :JSX.Element => {
    const data = Array.from(new Array(9)).map((_val, i) => ({
      icon: 'https://os.alipayobjects.com/rmsportal/IptWdCkrtkAUfjE.png',
      text: `名字${i}`,
    }));
    return (
      <Grid
        data={data}
        hasLine={false}
        onClick={(...args) => console.log(args)}
      />
    )
  }

你期待的结果是:

输出参数

实际上的结果:

没有任何反应

可重现的在线演示

  renderGrid = () :JSX.Element => {
    const data = Array.from(new Array(9)).map((_val, i) => ({
      icon: 'https://os.alipayobjects.com/rmsportal/IptWdCkrtkAUfjE.png',
      text: `名字${i}`,
    }));
    return (
      <Grid
        data={data}
        hasLine={false}
        onClick={(...args) => console.log(args)}
      />
    )
  }
@warmhug
Copy link
Contributor

warmhug commented Jan 22, 2017

已合并,下个版本发

@lock
Copy link

lock bot commented Jun 16, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants