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
Fixes 2 issue for Next.js (or any SSR method).
HAS_BEFORE_INPUT_SUPPORT.
They are added because the check fails server side and the warning arrises because the check works client side, resulting in the prop mismatch. The result is to force SSR users to add the following to avoid the warning.spellCheck, autoCorrect or autoCapitalize.
If the developer would like to opt-in to these features they can set them to true and the library will verify compatibility. However it is not possible to SSR render the application becauseHAS_BEFORE_INPUT_SUPPORT
is false on the server which overrides the develop props. If a developer/consumer would like to attempt to use this feature,HAS_BEFORE_INPUT_SUPPORT
results in false on the server and true on the browser which throws a warning for prop mismatch.Issue
Fixes:
Issue 4318
Issue 4657
Example
![Screen Shot 2021-11-21 at 9 02 29 PM](https://user-images.githubusercontent.com/18608739/142792775-f255baa3-ca61-409c-a81a-fb7ef226c71b.png)
![Screen Shot 2021-11-21 at 9 03 35 PM](https://user-images.githubusercontent.com/18608739/142792807-18c94e23-eda2-422a-ba29-425d6b85eaa6.png)
![Screen Shot 2021-11-21 at 9 35 21 PM](https://user-images.githubusercontent.com/18608739/142792857-d60953c1-0ec4-4bcf-b2f2-661c9a56dd2e.png)
![Screen Shot 2021-11-21 at 9 04 16 PM](https://user-images.githubusercontent.com/18608739/142792868-b7b245a1-6329-42d8-8f1f-5d6e06deddf7.png)
![Screen Shot 2021-11-21 at 9 04 40 PM](https://user-images.githubusercontent.com/18608739/142792872-726439fe-7487-4426-8961-01a1a0ae77b4.png)
Context
Only made change to how props are added to the component, did not change value check
HAS_BEFORE_INPUT_SUPPORT
which is used in other places and could potentially change how other parts of the render happen.Made this change to support developer ergonomics for SSR. No longer need to added the spellCheck, auotCorrect and autoCapitalize props to the component. Also made change to support users as 94.03% of users will miss out on the opportunity to use spellCheck, autoCorrect, autoCapitalize with a text editing library when used under SSR situations. Only drawback/tradeoff for this change is 6% of users will see a prop mismatch warning under SSR conditions (similar to issue 1) as the server will add the positive props and the client will not pass the
HAS_BEFORE_INPUT_SUPPORT
check.Checks
yarn test
.yarn lint
. (Fix errors withyarn fix
.)yarn start
.)yarn changeset add
.)