Skip to content

Commit

Permalink
fix: use useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
megheaiulian committed May 18, 2022
1 parent b614dd8 commit e19407d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/next/cosmoz-tab.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions src/next/cosmoz-tabs.js
Original file line number Diff line number Diff line change
@@ -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');
}, []);

Expand Down

0 comments on commit e19407d

Please sign in to comment.