mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-08-16 11:33:48 +00:00
Use memo
This commit is contained in:
parent
3dac8f96f3
commit
4a910893d0
1 changed files with 3 additions and 3 deletions
|
|
@ -9,12 +9,12 @@ const settingsValues = require('./useSettings');
|
|||
const devTestWithUser = true;
|
||||
|
||||
const Settings = () => {
|
||||
const sections = Object.keys(settingsSections)
|
||||
const sections = React.useMemo(() => Object.keys(settingsSections)
|
||||
.map((section) => ({
|
||||
id: section,
|
||||
inputs: settingsSections[section],
|
||||
ref: React.useRef(null)
|
||||
}));
|
||||
ref: React.createRef()
|
||||
})), []);
|
||||
const [selectedSectionId, setSelectedSectionId] = React.useState(sections[0].id);
|
||||
const [preferences, setPreferences] = settingsValues(devTestWithUser);
|
||||
const scrollContainerRef = React.useRef(null);
|
||||
|
|
|
|||
Loading…
Reference in a new issue