Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

The examples in the documentation contain type errors #1767

Open
lovasoa opened this issue May 6, 2021 · 0 comments
Open

The examples in the documentation contain type errors #1767

lovasoa opened this issue May 6, 2021 · 0 comments

Comments

@lovasoa
Copy link

lovasoa commented May 6, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant