• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atomicpages / pretty-checkbox-react / 8915003455

01 May 2024 09:07PM UTC coverage: 100.0%. Remained the same
8915003455

Pull #1098

github

web-flow
build(deps): bump ejs from 3.1.6 to 3.1.10 in /docs

Bumps [ejs](https://github.com/mde/ejs) from 3.1.6 to 3.1.10.
- [Release notes](https://github.com/mde/ejs/releases)
- [Commits](https://github.com/mde/ejs/compare/v3.1.6...v3.1.10)

---
updated-dependencies:
- dependency-name: ejs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #1098: build(deps): bump ejs from 3.1.6 to 3.1.10 in /docs

67 of 67 branches covered (100.0%)

Branch coverage included in aggregate %.

172 of 172 relevant lines covered (100.0%)

9.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/components/radio/useRadioState.ts
1
import * as React from 'react';
2✔
2

3
export type UseRadioState = {
4
  state?: boolean | string;
5
  onChange?: React.InputHTMLAttributes<HTMLInputElement>['onChange'];
6
};
7

8
export const useRadioState = ({
2✔
9
  state: initialState = false,
8✔
10
  onChange,
11
}: UseRadioState = {}) => {
12
  const [state, setState] = React.useState(initialState);
8✔
13

14
  return {
8✔
15
    state,
16
    setState,
17
    onChange: React.useCallback(
18
      (e: React.ChangeEvent<HTMLInputElement>) => {
19
        const { value } = e.currentTarget;
4✔
20

21
        setState((current) => {
4✔
22
          if (value !== '') {
4✔
23
            return value;
1✔
24
          }
25

26
          return !current;
3✔
27
        });
28

29
        if (typeof onChange === 'function') {
4✔
30
          onChange(e);
2✔
31
        }
32
      },
33
      [onChange]
34
    ),
35
  };
36
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc