Skip to content

Releases: uiwjs/react-only-when

v3.0.1

23 Mar 06:12
Compare
Choose a tag to compare

Buy me a coffee Coverage Status npm bundle size

npm i @uiw/react-only-when@3.0.1

v3.0.0...v3.0.1

v3.0.0

22 Mar 11:44
Compare
Choose a tag to compare

Buy me a coffee Coverage Status npm bundle size

npm i @uiw/react-only-when@3.0.0

v2.0.3...v3.0.0

v2.0.3

22 Mar 10:00
Compare
Choose a tag to compare

Buy me a coffee Coverage Status npm bundle size

npm i @uiw/react-only-when@2.0.3

v2.0.2...v2.0.3

v2.0.2

27 Nov 11:47
Compare
Choose a tag to compare

Buy me a coffee Coverage Status npm bundle size

npm i @uiw/react-only-when@2.0.2

v2.0.1...v2.0.2

v2.0.1

23 Sep 09:44
Compare
Choose a tag to compare

Coverage Status npm bundle size

npm i @uiw/react-only-when@2.0.1

v2.0.0...v2.0.1

v2.0.0

23 Sep 09:35
Compare
Choose a tag to compare

Coverage Status npm bundle size

npm i @uiw/react-only-when@2.0.0

v1.2.0...v2.0.0

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

17 Aug 09:01
Compare
Choose a tag to compare

Coverage Status npm bundle size

npm i @uiw/react-only-when@1.2.0

v1.1.1...v1.2.0

<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

08 Jun 05:25
Compare
Choose a tag to compare

Coverage Status npm bundle size

npm i @uiw/react-only-when@1.1.1

v1.1.0...v1.1.1

v1.1.0

08 Jun 01:56
Compare
Choose a tag to compare

Coverage Status npm bundle size

npm i @uiw/react-only-when@1.1.0

v1.0.6...v1.1.0

v1.0.6

10 Sep 08:47
Compare
Choose a tag to compare

Coverage Status npm bundle size

npm i @uiw/react-only-when@1.0.6

v1.0.5...v1.0.6

  • 💄 chore(deps): update dependency @uiw/react-github-corners to v1.5.3 (#22) 32b0a5b
  • 💄 chore(deps): update dependency prettier to v2.4.0 (#21) 13e4fd2
  • 💄 chore(deps): update dependency @uiw/react-markdown-preview to v3.3.2 (#19) d3ea872
  • 💄 chore(deps): update dependency tsbb to v3.1.5 (#20) f334ec7