Skip to content

Commit

Permalink
Event handler props on input component should be non-optional (#768)
Browse files Browse the repository at this point in the history
* Event handler props on input component should be non-optional

* version and changelog change

---------

Co-authored-by: rishabhpoddar <rishabh.poddar@gmail.com>
  • Loading branch information
amitbadala and rishabhpoddar committed Nov 26, 2023
1 parent 1baf355 commit 4ac34fd
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 24 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)

## [0.35.7] - 2023-11-16
## [0.35.8] - 2023-11-26

- Fixes `inputComponent` props to make them non optional. This is in the context of customizing the sign up form to add custom react components.

## [0.35.7] - 2023-11-24

### Added

Expand Down
6 changes: 3 additions & 3 deletions lib/build/recipe/emailpassword/components/library/input.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/version.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/ts/recipe/emailpassword/components/library/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export type InputProps = {
hasError: boolean;
placeholder: string;
value: string;
onInputBlur?: (value: string) => void;
onInputFocus?: (value: string) => void;
onChange?: (value: string) => void;
onInputBlur: (value: string) => void;
onInputFocus: (value: string) => void;
onChange: (value: string) => void;
};

const Input: React.FC<InputProps> = ({
Expand Down
2 changes: 1 addition & 1 deletion lib/ts/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const package_version = "0.35.7";
export const package_version = "0.35.8";
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supertokens-auth-react",
"version": "0.35.7",
"version": "0.35.8",
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
"main": "./index.js",
"engines": {
Expand Down
16 changes: 4 additions & 12 deletions test/with-typescript/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,7 @@ function getEmailPasswordConfigs() {
value={inputProps.value}
checked={inputProps.value === "true"}
onChange={(e) => {
if (inputProps.onChange) {
inputProps.onChange(e.target.checked.toString());
}
inputProps.onChange(e.target.checked.toString());
}}></input>
<span style={{ marginLeft: 5 }}>I agree to the terms and conditions</span>
</div>
Expand All @@ -421,21 +419,15 @@ function getEmailPasswordConfigs() {
inputComponent: (inputProps) => (
<select
onBlur={(e) => {
if (inputProps.onInputBlur) {
inputProps.onInputBlur(e.target.value);
}
inputProps.onInputBlur(e.target.value);
}}
onFocus={(e) => {
if (inputProps.onInputFocus) {
inputProps.onInputFocus(e.target.value);
}
inputProps.onInputFocus(e.target.value);
}}
value={inputProps.value}
name={inputProps.name}
onChange={(e) => {
if (inputProps.onChange) {
inputProps.onChange(e.target.value);
}
inputProps.onChange(e.target.value);
}}>
<option value="" disabled hidden>
Select an option
Expand Down

0 comments on commit 4ac34fd

Please sign in to comment.