From 2e763f6f1520100e77ef2d28cc89d25c51848a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Tue, 17 Oct 2023 15:55:48 +0800 Subject: [PATCH] chore: rm option len match (#986) * chore: rm option len match * chore: clean up --- docs/demo/scroll-loading.md | 2 ++ docs/examples/scroll-loading.tsx | 41 ++++++++++++++++++++++++++++++++ src/OptionList.tsx | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 docs/demo/scroll-loading.md create mode 100644 docs/examples/scroll-loading.tsx diff --git a/docs/demo/scroll-loading.md b/docs/demo/scroll-loading.md new file mode 100644 index 000000000..0358bd371 --- /dev/null +++ b/docs/demo/scroll-loading.md @@ -0,0 +1,2 @@ +## scroll loading + diff --git a/docs/examples/scroll-loading.tsx b/docs/examples/scroll-loading.tsx new file mode 100644 index 000000000..987810e33 --- /dev/null +++ b/docs/examples/scroll-loading.tsx @@ -0,0 +1,41 @@ +import Select from 'rc-select'; +import React from 'react'; +import '../../assets/index.less'; + +function genData(len: number) { + return new Array(len).fill(0).map((_, index) => ({ + label: `label ${index}`, + value: index, + })); +} + +const Loading = ({ onLoad }) => { + React.useEffect(() => { + setTimeout(onLoad, 1000); + }, []); + + return
Loading...
; +}; + +export default () => { + const [options, setOptions] = React.useState(() => genData(10)); + + return ( +