sapper
sapper copied to clipboard
The examples in the documentation contain type errors
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.startto 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.