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

PinInput cannot be used as JSX element #199

Open
brunobouwman opened this issue Apr 18, 2022 · 2 comments
Open

PinInput cannot be used as JSX element #199

brunobouwman opened this issue Apr 18, 2022 · 2 comments

Comments

@brunobouwman
Copy link

Everytime I add a new package I get this error regarding the PinInput module. Anyone has got a clue about what could be happening?

@arunghosh
Copy link
Owner

@brunobouwman Sorry for the delayed response. Can you provide more details on the React version and whether you are using Typescript?

@marklai1998
Copy link

marklai1998 commented Jul 26, 2022

@arunghosh I'm also running into this problem when I re-export a themed PinInput in my private package
It throws an error saying the type is invalid
image

My bundle

import ReactPinInput from 'react-pin-input';

const MyComp = ()=>{
// my component code
return /* @__PURE__ */ React.createElement(Wrapper$2, {
    currentIndex,
    hasError: error
  }, /* @__PURE__ */ React.createElement(ReactPinInput, {
    type: "numeric",
    length: 4,
    inputMode: "number",
    inputStyle: {
      width: "52px",
      height: "52px",
      borderRadius: "2px",
      margin: "0 16px 0 0",
      fontSize: "36px",
      lineHeight: "40px",
      textAlign: "center",
      border: `1px solid ${error ? theme.colors.errorColor : theme.colors.inputBorderColor}`
    },
    inputFocusStyle: {
      border: `1px solid ${error ? theme.colors.errorColor : theme.colors.activeColor}`
    },
    disabled,
    onChange: setCurrentValue,
    onComplete,
    initialValue: value,
    ref: inputRef,
    focus: true
  }));
}

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

No branches or pull requests

3 participants