Skip to content

Commit 4ac34fd

Browse files
Event handler props on input component should be non-optional (#768)
* Event handler props on input component should be non-optional * version and changelog change --------- Co-authored-by: rishabhpoddar <[email protected]>
1 parent 1baf355 commit 4ac34fd

File tree

8 files changed

+20
-24
lines changed

8 files changed

+20
-24
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
77

8-
## [0.35.7] - 2023-11-16
8+
## [0.35.8] - 2023-11-26
9+
10+
- Fixes `inputComponent` props to make them non optional. This is in the context of customizing the sign up form to add custom react components.
11+
12+
## [0.35.7] - 2023-11-24
913

1014
### Added
1115

lib/build/recipe/emailpassword/components/library/input.d.ts

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/version.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ts/recipe/emailpassword/components/library/input.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export type InputProps = {
3131
hasError: boolean;
3232
placeholder: string;
3333
value: string;
34-
onInputBlur?: (value: string) => void;
35-
onInputFocus?: (value: string) => void;
36-
onChange?: (value: string) => void;
34+
onInputBlur: (value: string) => void;
35+
onInputFocus: (value: string) => void;
36+
onChange: (value: string) => void;
3737
};
3838

3939
const Input: React.FC<InputProps> = ({

lib/ts/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
* License for the specific language governing permissions and limitations
1313
* under the License.
1414
*/
15-
export const package_version = "0.35.7";
15+
export const package_version = "0.35.8";

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "supertokens-auth-react",
3-
"version": "0.35.7",
3+
"version": "0.35.8",
44
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
55
"main": "./index.js",
66
"engines": {

test/with-typescript/src/App.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,7 @@ function getEmailPasswordConfigs() {
400400
value={inputProps.value}
401401
checked={inputProps.value === "true"}
402402
onChange={(e) => {
403-
if (inputProps.onChange) {
404-
inputProps.onChange(e.target.checked.toString());
405-
}
403+
inputProps.onChange(e.target.checked.toString());
406404
}}></input>
407405
<span style={{ marginLeft: 5 }}>I agree to the terms and conditions</span>
408406
</div>
@@ -421,21 +419,15 @@ function getEmailPasswordConfigs() {
421419
inputComponent: (inputProps) => (
422420
<select
423421
onBlur={(e) => {
424-
if (inputProps.onInputBlur) {
425-
inputProps.onInputBlur(e.target.value);
426-
}
422+
inputProps.onInputBlur(e.target.value);
427423
}}
428424
onFocus={(e) => {
429-
if (inputProps.onInputFocus) {
430-
inputProps.onInputFocus(e.target.value);
431-
}
425+
inputProps.onInputFocus(e.target.value);
432426
}}
433427
value={inputProps.value}
434428
name={inputProps.name}
435429
onChange={(e) => {
436-
if (inputProps.onChange) {
437-
inputProps.onChange(e.target.value);
438-
}
430+
inputProps.onChange(e.target.value);
439431
}}>
440432
<option value="" disabled hidden>
441433
Select an option

0 commit comments

Comments
 (0)