0

I want to display the text "scrolling" when I am scrolling but nothing happens. It does not show the text. What I am doing wrong ?

code:

      <List
        innerElementType="ul"
        itemCount={data.length}
        itemSize={20}
        height={700}
        width={400}
      >
        {({ index, style, isScrolling }) => {
          if(isScrolling) {
           return <p style={{color: 'black'}}>scrolling</p>
          } else {
            return (
              <li style={style}>
                {data[index]}
              </li>
            );
          }
        }}
      </List>
1
  • 1
    I think you're just missing useIsScrolling prop on the List. If it is not there isScrolling is not available. You see an working example in the following Codesandbox Demo. Also mentioned in the example Commented Dec 15, 2024 at 13:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.