Skip to content

Commit e9cebd1

Browse files
committed
First comment changes
1 parent 7c6cb52 commit e9cebd1

File tree

1 file changed

+5
-4
lines changed
  • packages/react-components/source/react/library/tag

1 file changed

+5
-4
lines changed

packages/react-components/source/react/library/tag/Tag.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react';
2-
import { node, func } from 'prop-types';
2+
import { func, string } from 'prop-types';
33
import Button from '../button';
44
import Text from '../text';
55

66
const propTypes = {
77
/** Tag text or other content */
8-
children: node.isRequired,
8+
label: string.isRequired,
99
/** Callback function called when clode icon is clicked */
1010
onClick: func,
1111
};
@@ -14,16 +14,17 @@ const defaultProps = {
1414
onClick: () => {},
1515
};
1616

17-
const Tag = ({ children, onClick }) => {
17+
const Tag = ({ label, onClick }) => {
1818
return (
1919
<div className="rc-tag">
2020
<div className="rc-tag-label-background">
21-
<Text className="rc-tag-text">{children}</Text>
21+
<Text className="rc-tag-text">{label}</Text>
2222
</div>
2323
<Button
2424
className="rc-tag-remove-button"
2525
onClick={() => onClick()}
2626
icon="close"
27+
aria-label={`${label} Remove tag`}
2728
/>
2829
</div>
2930
);

0 commit comments

Comments
 (0)