Skip to content

Commit 4fd43ec

Browse files
committed
7.5.0
1 parent 162ae45 commit 4fd43ec

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## 7.5.0
6+
7+
- Fix typescript error `Type Error: 'Cursor' cannot be used as a JSX component`
8+
9+
510
## 7.4.0
611

712
- Add `autoComplete` prop by default, for `CodeField` component [#239](https://github.com/retyui/react-native-confirmation-code-field/pull/239)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-confirmation-code-field",
3-
"version": "7.4.0",
3+
"version": "7.5.0",
44
"main": "esm/index.js",
55
"types": "esm/index.d.ts",
66
"files": [

src/Cursor.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {useState} from 'react';
1+
import {useState, ReactNode} from 'react';
22
import {useInterval} from './useTimer';
33

44
export const DEFAULT_BLINKING_SPEED = 500;
@@ -7,11 +7,10 @@ export const DEFAULT_CURSOR_SYMBOL = '|';
77
export function Cursor({
88
cursorSymbol = DEFAULT_CURSOR_SYMBOL,
99
delay = DEFAULT_BLINKING_SPEED,
10-
}): React.JSX.Element {
10+
}): ReactNode {
1111
const [visibleFlag, setFlag] = useState(true);
1212

1313
useInterval(() => setFlag((flag) => !flag), delay);
1414

15-
// @ts-expect-error `JSX.Element` is not a `ReactNode`
1615
return visibleFlag ? cursorSymbol : '';
1716
}

0 commit comments

Comments
 (0)