fix(template-preact-ts): add preact compat paths to tsconfig #12027
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This patch adds React compatibility types to template-preact-ts so that new projects using
create-vite
with Preact and TypeScript include these by default.Additional context
I ran into some typing issues trying to use
react-redux
with this Preact template.Preact's docs specify that you can add some type paths to add compatibility for Preact with libraries meant for React.
Many people use Preact as a faster, lightweight, and compatible alternative to React, so most developers are likely going to use libraries meant for React with Preact. This change removes friction, with what seems to be little added cost, so that developers can quickly get started on a new project.
I'm also happy to turn this PR into a discussion thread if this change is unwanted. (Also, thanks for making Vite; I've never been able to spin up a new project with little overhead this easily before!)
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).