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

Provide react-bootstrap Level of Support #3

Open
1 of 2 tasks
SimpleSigner opened this issue Sep 4, 2021 · 5 comments
Open
1 of 2 tasks

Provide react-bootstrap Level of Support #3

SimpleSigner opened this issue Sep 4, 2021 · 5 comments

Comments

@SimpleSigner
Copy link
Owner

SimpleSigner commented Sep 4, 2021

As raised by @richtera - the library lacks Typescript definitions, and does not support the use of ref as our functional components need to make use of React.forwardRef.

  • Rewrite the project in Typescript.
  • Rewrite components in terms of React.forwardRef where needed.

See:

@SimpleSigner
Copy link
Owner Author

@SimpleSigner
Copy link
Owner Author

The following is required to support JSX syntax inside of .ts files, it appears @babel/preset-typescript expects one to use the .tsx file extension to automagically pick up on the syntax. Without this configuration, the transpiler assumes the <div> syntax represents some form of type declaration, rather than JSX for a <div> element.

[
  '@babel/preset-typescript',
  {
    allExtensions: true,
    isTSX: true,
  }
],

See: https://babeljs.io/docs/en/babel-preset-typescript

@SimpleSigner
Copy link
Owner Author

One will need to use a multi-phase compilation project, first using tsc (via npm install --save-dev typescript) to type check the project and generate the type definitions, second using Webpack / Babel to generate the JS bundle.

See: https://www.typescriptlang.org/docs/handbook/babel-with-typescript.html

@SimpleSigner
Copy link
Owner Author

The forwardRef issue was not specifically because of references but because of a mismatch between react-bootstrap versions.
Added a peerDependency definition to avoid this problem in the future.

@SimpleSigner
Copy link
Owner Author

See: #4

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

1 participant