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

不支持render内写方法,传参数? #1869

Closed
xiaofengz opened this issue Jan 9, 2019 · 3 comments
Closed

不支持render内写方法,传参数? #1869

xiaofengz opened this issue Jan 9, 2019 · 3 comments
Assignees

Comments

@xiaofengz
Copy link

render() {
        const renderContent = () => {
            return (
                <View>1</View>
            )
        }
        return (
            <View className='index'>
                    <View className='filter-content'>
                        {renderContent()}
                    </View>
            </View>
        )
    }

报错了
image

如果不支持此写法,那什么写法是支持的呢?
谢谢~

@taro-bot
Copy link

taro-bot bot commented Jan 9, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@yuche
Copy link
Contributor

yuche commented Jan 9, 2019

你就正常写,不支持后续会报错具体的地点,这里没有报应该是漏了处理 render 下定义的情况。
或者可以看文档最佳实践:
https://nervjs.github.io/taro/docs/best-practice.html#docsNav

你这个特性规划在 v1.3,现在那个分支已经实现了,不过发布到 npm 还需要更多调试。

@yuche yuche self-assigned this Jan 9, 2019
@yuche
Copy link
Contributor

yuche commented Jan 9, 2019

Duplicate of #157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants