Skip to content

Number 0 appears when finish loading message appears #377

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

Open
bronzegod3 opened this issue Mar 21, 2023 · 1 comment
Open

Number 0 appears when finish loading message appears #377

bronzegod3 opened this issue Mar 21, 2023 · 1 comment

Comments

@bronzegod3
Copy link

Getting a 0 showing up on screen when no data is present

Code:

  <InfiniteScroll
          dataLength={0}
          next={this.fetchMoreData}
          hasMore={0}
          loader={<h4>Loading...</h4>}
          endMessage={
            <p style={{ textAlign: "center" }}>
              <b>Yay! You have seen it all</b>
            </p>
          }
        >
        </InfiniteScroll>

results in html :

<infiinite-scroller... >
"0"
  <p style={{ textAlign: "center" }}>
              <b>Yay! You have seen it all</b>
            </p>
</infinite-scroller>
@AreebKhan619
Copy link

This is most likely happening because you're sending a number instead of a boolean. Have you tried changing it to hasMore=Boolean(0) or hasMore={false}?

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