0

i an getting an error in my react build online, even though it seems to be working fine locally.

react-dom.production.min.js:189 TypeError: Cannot read properties of undefined (reading 'length') at VK (MyChallengeTab.js:59:23)

The code below is here the error is coming from, anyone with a fix pls? Pls provide me with an edit to correct for this?

<div className="m-4">
        <Pagination
          total={data.length}
          defaultCurrent={page}
          defaultPageSize={perPage}
          showTotal={(total) => `Total ${total} items`}
          onChange={handleMyChange}
        />
      </div>
5
  • I'd guess the problem is that data is null. Where's that coming from?
    – Rup
    Commented Mar 23, 2023 at 10:22
  • I'm a bit behind on the new block editor: is this a Gutenberg block? Is Pagination provided by WordPress?
    – Rup
    Commented Mar 23, 2023 at 10:25
  • this is react js
    – Mad Crowe
    Commented Mar 23, 2023 at 15:45
  • Yes sure, but you've posted this on the WordPress Development and WordPress's Gutenberg blocks use react, so I was asking if this is a Gutenberg block. I guess it isn't then, this has no connection to WordPress?
    – Rup
    Commented Mar 23, 2023 at 16:01
  • None at all. Thank you for bringing it to my notification
    – Mad Crowe
    Commented Mar 23, 2023 at 16:44

0

Your Answer

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

Browse other questions tagged or ask your own question.