Open SimpleSigner opened 2 years ago
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,
}
],
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
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.
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 ofReact.forwardRef
.React.forwardRef
where needed.See: