title: Error in building app with react-hook-form using TS
body: <p>I get the following error when I try to build my react app using react-hook-form in TS:</p>
  <pre><code>node_modules/react-hook-form/dist/types/utils.d.ts:24:77 - error TS1005: '?' expected.
  
  24 declare type PathImpl&lt;K extends string | number, V&gt; = V extends Primitive ? `${K}` : `${K}` | `${K}.${Path&lt;V&gt;}`;
                                                                                 ~~~
  
  node_modules/react-hook-form/dist/types/utils.d.ts:24:84 - error TS1005: ';' expected.
  
  24 declare type PathImpl&lt;K extends string | number, V&gt; = V extends Primitive ? `${K}` : `${K}` | `${K}.${Path&lt;V&gt;}`;
                                                                                        ~
  
  node_modules/react-hook-form/dist/types/utils.d.ts:24:110 - error TS1005: '(' expected.
  
  24 declare type PathImpl&lt;K extends string | number, V&gt; = V extends Primitive ? `${K}` : `${K}` | `${K}.${Path&lt;V&gt;}`;
  </code></pre>
  <p>And here's my build command:</p>
  <pre><code>yarn tsc --emitDeclarationOnly &amp;&amp; tsc-alias -p tsconfig.json
  </code></pre>
  <p>Here's my tsconfig.json:</p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      &quot;target&quot;: &quot;esnext&quot;,
      &quot;module&quot;: &quot;esnext&quot;,
      &quot;lib&quot;: [
        &quot;dom&quot;,
        &quot;dom.iterable&quot;,
        &quot;esnext&quot;
      ],
      &quot;allowJs&quot;: true,
      &quot;skipLibCheck&quot;: true,
      &quot;strict&quot;: true,
      &quot;forceConsistentCasingInFileNames&quot;: true,
      &quot;moduleResolution&quot;: &quot;node&quot;,
      &quot;resolveJsonModule&quot;: true,
      &quot;isolatedModules&quot;: false,
      &quot;jsx&quot;: &quot;react&quot;,
      &quot;declaration&quot;: true,
      &quot;outDir&quot;: &quot;dist&quot;,
      &quot;rootDir&quot;: &quot;src&quot;,
      &quot;downlevelIteration&quot;: true,
      &quot;noImplicitAny&quot;: false,
      &quot;allowSyntheticDefaultImports&quot;: true,
      &quot;esModuleInterop&quot;: true,
      &quot;noEmit&quot;: false,
      &quot;baseUrl&quot;: &quot;./src&quot;,
      &quot;paths&quot;: {
        &quot;@context/*&quot;: [
          &quot;context/*&quot;
        ],
        &quot;@types&quot;: [
          &quot;types/index.ts&quot;
        ]
      }
    },
    &quot;include&quot;: [
      &quot;src/**/*&quot;,
    ],
    &quot;exclude&quot;: [
      &quot;node_modules/&quot;,
      &quot;./src/**/*.stories.tsx&quot;,
      &quot;./src/**/*.test.tsx&quot;,
      &quot;./src/**/__mocks__/**/*&quot;
    ]
  }
  </code></pre>
  <p>I'm using react-hook-form version 7.6.6. Any suggestion on how to fix this would be much appreciated!</p>