sapper icon indicating copy to clipboard operation
sapper copied to clipboard

The examples in the documentation contain type errors

Open lovasoa opened this issue 4 years ago • 0 comments
trafficstars

The documentation contains the following example :

sapper.start({
	target: document.querySelector('#sapper')
});

However, document.querySelector('#sapper') can return null, but sapper.start does not accept null. It would be great to either

  • update the type definition of sapper.start to accept null (and throw an error saying that the target element is missing in this case),
  • or update the documentation to check for null before calling sapper.start.

This would allow the documentation examples to be copy-pasted in typescript environment without type errors.

lovasoa avatar May 06 '21 12:05 lovasoa