Skip to content

Commit d2ca132

Browse files
authored
Merge pull request #75 from NHSDigital/feature/renderHintAsDiv
NHS.UK 4 - Render Hint as div element, not span
2 parents 4becb36 + 54c1b39 commit d2ca132

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ The `WarningCallout.Label` now has the hidden text `Important: ` before the labe
4545
Something Much Less Important
4646
</WarningCallout.Label>
4747
```
48+
49+
## Hint component renders as div
50+
51+
The `Hint` component now renders as a `div` element rather than a `span`.

src/components/hint/Hint.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { HTMLProps } from 'react';
22
import classNames from 'classnames';
33

4-
export type HintProps = HTMLProps<HTMLSpanElement>;
4+
export type HintProps = HTMLProps<HTMLDivElement>;
55

66
const Hint: React.FC<HintProps> = ({ className, ...rest }) => (
7-
<span className={classNames('nhsuk-hint', className)} {...rest} />
7+
<div className={classNames('nhsuk-hint', className)} {...rest} />
88
);
99

1010
export default Hint;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Hint matches snapshot: Hint 1`] = `
4-
<span
4+
<div
55
className="nhsuk-hint"
66
>
77
Text
8-
</span>
8+
</div>
99
`;

0 commit comments

Comments
 (0)