Skip to content
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

Error Message: TypeError: k.split is not a function #8

Open
Geraldf opened this issue Nov 13, 2022 · 1 comment
Open

Error Message: TypeError: k.split is not a function #8

Geraldf opened this issue Nov 13, 2022 · 1 comment

Comments

@Geraldf
Copy link

Geraldf commented Nov 13, 2022

I am getting the below error message in line 15 at the file "node_modules/react-mask-field/dist/index.esm.js"

TypeError: k.split is not a function

(anonymous function)
node_modules/react-mask-field/dist/index.esm.js:15
  12 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  13 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  14 | PERFORMANCE OF THIS SOFTWARE.
> 15 | ***************************************************************************** */var o=function(e,r){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])})(e,r)};var c=function(){return(c=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)};function i(e){var r;return"string"==typeof e?((r={})[e]=/./,r):e}function s(e){var r=e.value,t=e.replaceableSymbols,n=e.replacement,a=e.separate,u=t;return r.split("").reduce((function(e,r){var t,l=Object.prototype.hasOwnProperty.call(n,r),o=null===(t=n[u[0]])||void 0===t?void 0:t.test(r);return(a?l||o:!l&&o)?(u=u.slice(1),e+r):e}),"")}function p(e)

when I perform this code

export const CardNumberInput = forwardRef<
  HTMLInputElement,
  InputBaseComponentProps
>((props, ref) => {
  const { mask } = props;
  return (
    <MaskField
      ref={ref}
      // mask="____ ____ ____ ____"
      showMask={true}
      replacement={{ _: /\d/ }}
      {...props}
    />
  );
});

type Props = TextFieldProps & {
  mask: string;
  replacement: string | object;
  showMask?: boolean;
};

export const Example = (props: Props) => {
  const { mask } = props;

  return (
    <CustomTextfield
      {...props}
      //inputProps={CardNumberInput}
      InputProps={{
        inputComponent: CardNumberInput,
        inputProps: {
          mask: { mask },
        },
      }}
    />
  );
};
@GoncharukBro
Copy link
Owner

Could you provide more detailed code?

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