Skip to content

Fix ReferenceError: arguments undefined in SearchBar.js debounce function #1820

Description

@ARSHADAMEEN00

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-bootstrap-table2-toolkit@2.1.3 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-bootstrap-table2-toolkit/lib/src/search/SearchBar.js b/node_modules/react-bootstrap-table2-toolkit/lib/src/search/SearchBar.js
index 334901e..e922f88 100644
--- a/node_modules/react-bootstrap-table2-toolkit/lib/src/search/SearchBar.js
+++ b/node_modules/react-bootstrap-table2-toolkit/lib/src/search/SearchBar.js
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
 
 var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
 
-var _arguments = arguments; /* eslint camelcase: 0 */
+/* eslint camelcase: 0 */
 /* eslint no-return-assign: 0 */
 
 var _react = require('react');
@@ -33,7 +33,7 @@ var handleDebounce = function handleDebounce(func, wait, immediate) {
       timeout = null;
 
       if (!immediate) {
-        func.apply(undefined, _arguments);
+        func.apply(undefined, arguments);
       }
     };
 
@@ -44,7 +44,7 @@ var handleDebounce = function handleDebounce(func, wait, immediate) {
     timeout = setTimeout(later, wait || 0);
 
     if (callNow) {
-      func.appy(undefined, _arguments);
+      func.apply(undefined, arguments);
     }
   };
 };

This issue body was partially generated by patch-package.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions