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
ghost opened this issue Sep 4, 2021 · 5 comments
Open
1 of 2 tasks

Provide react-bootstrap Level of Support #3

ghost opened this issue Sep 4, 2021 · 5 comments

Comments

@ghost
Copy link

ghost 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:

@ghost
Copy link
Author

ghost commented Apr 23, 2022

@ghost
Copy link
Author

ghost commented Apr 30, 2022

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

@ghost
Copy link
Author

ghost commented May 29, 2022

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

@ghost
Copy link
Author

ghost commented Jun 5, 2022

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.

@ghost
Copy link
Author

ghost commented Jun 5, 2022

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

0 participants