From e19407d9af476092f628bbc1b3da2fb5b6fba630 Mon Sep 17 00:00:00 2001 From: Meghea Iulian Date: Wed, 18 May 2022 14:13:57 +0300 Subject: [PATCH] fix: use useEffect --- src/next/cosmoz-tab.js | 4 ++-- src/next/cosmoz-tabs.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/next/cosmoz-tab.js b/src/next/cosmoz-tab.js index 40840b7..9e46461 100644 --- a/src/next/cosmoz-tab.js +++ b/src/next/cosmoz-tab.js @@ -1,4 +1,4 @@ -import { component, useLayoutEffect } from 'haunted'; +import { component, useEffect, useLayoutEffect } from 'haunted'; import { html, nothing } from 'lit-html'; import { ifDefined } from 'lit-html/directives/if-defined'; import computeScroll from 'compute-scroll-into-view'; @@ -8,7 +8,7 @@ import style from './cosmoz-tab.css'; const Tab = (host) => { const { active, badge, href } = host; - useLayoutEffect(() => { + useEffect(() => { if (!host.getAttribute('tabindex')) { host.setAttribute('tabindex', '-1'); } diff --git a/src/next/cosmoz-tabs.js b/src/next/cosmoz-tabs.js index f3895c6..c3aa526 100644 --- a/src/next/cosmoz-tabs.js +++ b/src/next/cosmoz-tabs.js @@ -1,8 +1,8 @@ -import { html, component, useLayoutEffect } from 'haunted'; +import { html, component, useEffect } from 'haunted'; import style from './cosmoz-tabs.css'; const Tabs = (host) => { - useLayoutEffect(() => { + useEffect(() => { host.setAttribute('role', 'tablist'); }, []);