-1

VScode complains about html parameter being any, I cannot change to html: string so how to specify a string in this case ?

  const concatSource = ({html}) => {
    source = `
      <html>
          ${html}
      </html>
    `
    return souce
  }
user310291
  • 36,946
  • 82
  • 271
  • 487
  • 2
    Does this answer your question? [Typed function parameters using destructuring and rest in TypeScript](https://stackoverflow.com/questions/53329592/typed-function-parameters-using-destructuring-and-rest-in-typescript) – jonrsharpe Jul 02 '21 at 09:54

1 Answers1

0

Like this:

const concatSource = ({
  html
}: { html: string }) => {
  source = `
      <html>
          ${html}
      </html>
    `
  return souce
}
Olian04
  • 6,480
  • 2
  • 27
  • 54