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

got propsType check error when set boundary #14

Closed
yunxifd opened this issue May 10, 2019 · 1 comment · Fixed by #15
Closed

got propsType check error when set boundary #14

yunxifd opened this issue May 10, 2019 · 1 comment · Fixed by #15

Comments

@yunxifd
Copy link
Contributor

yunxifd commented May 10, 2019

my code

 <ScrollIntoViewIfNeeded
                  elementType="tr"
                  options={{
                      behavior: 'smooth',
                      block: 'nearest',
                      scrollMode: 'if-needed',
                      boundary: document.getElementById('preAllocation-select-panel')
                  }}
                  active={active}
                  {...props}/>
          );

got error

webpack-internal:///./node_modules/fbjs/lib/warning.js:33 Warning: Failed prop type: Invalid prop `options.boundary` supplied to `ScrollIntoViewIfNeeded`.
    in ScrollIntoViewIfNeeded (created by CustomRow)
    in CustomRow (created by BodyRow)
    in BodyRow (created by TableRow)
    in TableRow (created by Connect(TableRow))
....

I found source code
https://github.com/icd2k3/react-scroll-into-view-if-needed/blob/master/src/index.js#L38

because document.getElementById('preAllocation-select-panel') return Element object witch is not React Element . so got error.

@yunxifd yunxifd changed the title get propsType check error when set boundary got propsType check error when set boundary May 10, 2019
@icd2k3
Copy link
Owner

icd2k3 commented May 10, 2019

Thanks for fixing this!

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

Successfully merging a pull request may close this issue.

2 participants