Skip to content

Commit

Permalink
release(tab): v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed May 16, 2024
1 parent 0a4fcfb commit 5f4ad7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@
},
"tab": {
"react": true,
"version": "0.3.0",
"version": "0.3.1",
"style": true,
"icon": false,
"test": true,
Expand Down
2 changes: 1 addition & 1 deletion src/tab/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tab",
"version": "0.3.0",
"version": "0.3.1",
"description": "Easy tabs",
"luna": {
"react": true
Expand Down
11 changes: 8 additions & 3 deletions src/tab/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,19 @@ export const LunaTabItem: FC<ITabItemProps> = (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
}

Expand Down

0 comments on commit 5f4ad7c

Please sign in to comment.