Skip to content

got propsType check error when set boundary  #14

Closed
@yunxifd

Description

@yunxifd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions