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

undefined is not an object (evaluating curItemLayoutInfo.layout) #152

Open
claudepark opened this issue Nov 17, 2018 · 0 comments
Open

undefined is not an object (evaluating curItemLayoutInfo.layout) #152

claudepark opened this issue Nov 17, 2018 · 0 comments

Comments

@claudepark
Copy link

I got an error that message is 'undefined is not an object (evaluating curItemLayoutInfo.layout)'

_visibleDetect() method in PagerTtileIndicator
const { width, x: curItemOffsetX } = curItemLayoutInfo.layout;

I called asynchronous api and I got datas using title of PagerTitleIndicator prop.
and I called this.viewPager.setPage(initIdx) but it occurs above error.
So, I think it is asynchronous issue.

I hacked this issue.

state = {
trackScoll : false
}
<PagerTitleIndicator
...other props,
titles={this.state.asyncTitleDatas}
trackScroll={this.state.trackScroll}

/>

componentDidUpdate(prevProps, prevState) {
if (prevState !== this.states) {
var initPosition = this._findInitPosition(data);
this.viewPager.setPage(initPosition )
this.setState({trackScroll:true})
}
}

is it other solution?

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

1 participant