Releases: uiwjs/react-only-when
Releases · uiwjs/react-only-when
v3.0.1
v3.0.0
npm i @uiw/react-only-when@3.0.0
- 🐝 refactor: refactor Switch components. #50 e750f70 @jaywcjlove
- 🌍 website(deps): update dependency @uiw/react-markdown-preview-example to v2 #48 481e664 @jaywcjlove
- 💄 chore(deps): update dependency husky to v9 (#49) 5e0874c @renovate-bot
- 💄 chore(deps): update dependency lerna to v8 (#47) 66c8c13 @renovate-bot
- 💄 chore(deps): update dependency lint-staged to v15 (#46) 87a7453 @renovate-bot
- 💢 ci: modify husky config. 79d2aa0 @jaywcjlove
v2.0.3
npm i @uiw/react-only-when@2.0.3
- 💊 clean: remove redundant code. #50 74c5542 @jaywcjlove
v2.0.2
npm i @uiw/react-only-when@2.0.2
- 💄 chore: add sponsor badge. 8ec05d0 @jaywcjlove
- 💢 ci: update workflows config. cafce39 @jaywcjlove
v2.0.1
v2.0.0
npm i @uiw/react-only-when@2.0.0
- 💄 chore: update renovate.json f2434a3 @jaywcjlove
- 📖 doc: Update README.md 879e8ed @jaywcjlove
- 📄 Update LICENSE a75188d @jaywcjlove
- 💢 ci: update lintstaged config. 7b9e5d8 @jaywcjlove
- 🌟 feat(Case): add
as
props & refactor code. (#45) 0cfc8b8 @jaywcjlove
Defaults to specifying a wrapped HTML Element.
import React, { useState, Fragment } from 'react';
import { Switch, Case, Default } from '@uiw/react-only-when/switch'
export default function App() {
const [age, setAge] = useState(19)
return (
<Fragment>
<input type="range" onChange={(evn) => setAge(Number(evn.target.value))} /> {age}
<br />
<Switch>
<Case as="span" condition={age < 6}>Preschool</Case>
<Case as="em" condition={age >= 6 && age < 18}>Primary school</Case>
<Case as="div" condition={age >= 18 && age < 60}>Went to college</Case>
<Default as="p">you graduated</Default>
</Switch>
</Fragment>
);
}
v1.2.0
npm i @uiw/react-only-when@1.2.0
- 🌍 website: update website code preview. 716292d @jaywcjlove
- 💄 chore: update workflows config. 8488a56 @jaywcjlove
- 💄 chore: update workflows config. ed9c7ad @jaywcjlove
- 🌟 feat: add Switch component. 2d4ad56 @jaywcjlove
- 🌟 feat: className/hiddenMode add default value. 1646906 @jaywcjlove
- 📖 doc: Update README.md 28c851d @jaywcjlove
<Switch />
import { Switch, Case, Default } from '@uiw/react-only-when/switch'
<Switch>
<Case condition={age < 6}>preschool</Case>
<Case condition={age >= 6}>primary school</Case>
<Default>you graduated</Default>
</Switch>
v1.1.1
npm i @uiw/react-only-when@1.1.1
- 🌟 feat: support
@uiw/react-only-when/if
. a052b5d @jaywcjlove
v1.1.0
npm i @uiw/react-only-when@1.1.0
- 💄 chore: update .github/workflows/ci.yml b3e6b1d @jaywcjlove
- 💄 chore: update .github/workflows/ci.yml 3edafe4 @jaywcjlove
- 💄 chore(deps): update dependency kkt to v7. 8ff72d7 @jaywcjlove
- 💄 chore: update workflows config. 7ef159e @jaywcjlove
- 💄 chore(deps): update dependency tsbb to v4 #36 a7aab35 @jaywcjlove
- 💄 chore: update tsconfig.json 4c60312 @jaywcjlove
- 🌟 feat: add component. c275d45 @jaywcjlove
v1.0.6
npm i @uiw/react-only-when@1.0.6