docs: fix Rate demo type for strict mode (#46520)

* docs: fix Rate demo type for strict mode

* Apply suggestions from code review

Co-authored-by: lijianan <574980606@qq.com>
Signed-off-by: afc163 <afc163@gmail.com>

---------

Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: lijianan <574980606@qq.com>
This commit is contained in:
afc163 2023-12-19 12:38:09 +08:00 committed by GitHub
parent 3825cbca54
commit b3956a9ba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,9 +12,9 @@ const customIcons: Record<number, React.ReactNode> = {
const App: React.FC = () => (
<>
<Rate defaultValue={2} character={({ index }: { index: number }) => index + 1} />
<Rate defaultValue={2} character={({ index = 0 }) => index + 1} />
<br />
<Rate defaultValue={3} character={({ index }: { index: number }) => customIcons[index + 1]} />
<Rate defaultValue={3} character={({ index = 0 }) => customIcons[index + 1]} />
</>
);