diff --git a/index.json b/index.json index 084fa48..43af4f0 100644 --- a/index.json +++ b/index.json @@ -325,7 +325,7 @@ }, "tab": { "react": true, - "version": "0.3.0", + "version": "0.3.1", "style": true, "icon": false, "test": true, diff --git a/src/tab/package.json b/src/tab/package.json index 5143825..b30a763 100644 --- a/src/tab/package.json +++ b/src/tab/package.json @@ -1,6 +1,6 @@ { "name": "tab", - "version": "0.3.0", + "version": "0.3.1", "description": "Easy tabs", "luna": { "react": true diff --git a/src/tab/react.tsx b/src/tab/react.tsx index f6b81b9..2d787f5 100644 --- a/src/tab/react.tsx +++ b/src/tab/react.tsx @@ -74,14 +74,19 @@ export const LunaTabItem: FC = (props) => { id: props.id, title: props.title, }) - if (props.selected) { - props.tab.select(props.id) - } } return () => props.tab?.remove(props.id) }, [props.tab]) + useEffect(() => { + if (props.tab) { + if (props.selected) { + props.tab.select(props.id) + } + } + }, [props.selected]) + return null }