mirror of
https://github.com/outline/outline.git
synced 2026-11-22 22:02:35 +03:00
Move mount useEffect to top, convention
This commit is contained in:
1 parent
64992aab51
commit
2ad2dbc69e
1 file changed
+4
-4
@@ -44,6 +44,10 @@ const FilterOptions = ({
|
||||
});
|
||||
const [filteredData, setFilteredData] = React.useState<TFilterOption[]>([]);
|
||||
|
||||
React.useEffect(() => {
|
||||
setFilteredData(options);
|
||||
}, [options]);
|
||||
|
||||
const selected =
|
||||
options.find((option) => option.key === activeKey) || options[0];
|
||||
|
||||
@@ -70,10 +74,6 @@ const FilterOptions = ({
|
||||
[clearFilter, options]
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
setFilteredData(options);
|
||||
}, [options]);
|
||||
|
||||
return (
|
||||
<Wrapper>
|
||||
<MenuButton {...menu} onClick={clearFilter}>
|
||||
|
||||
Reference in new issue
Block a user