Skip to content

Commit b498958

Browse files
ref(js): Convert U2fContainer to a FC (#34630)
1 parent bea35d7 commit b498958

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed
Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import {Component} from 'react';
2-
31
import {Authenticator} from 'sentry/types';
42

53
import U2fSign from './u2fsign';
@@ -11,24 +9,20 @@ type Props = {
119
displayMode?: U2fSign['props']['displayMode'];
1210
};
1311

14-
class U2fContainer extends Component<Props> {
15-
render() {
16-
const {className, authenticators} = this.props;
17-
18-
if (!authenticators.length) {
19-
return null;
20-
}
21-
22-
return (
23-
<div className={className}>
24-
{authenticators.map(auth =>
25-
auth.id === 'u2f' && auth.challenge ? (
26-
<U2fSign key={auth.id} {...this.props} challengeData={auth.challenge} />
27-
) : null
28-
)}
29-
</div>
30-
);
12+
function U2fContainer({className, authenticators, ...props}: Props) {
13+
if (!authenticators.length) {
14+
return null;
3115
}
16+
17+
return (
18+
<div className={className}>
19+
{authenticators.map(auth =>
20+
auth.id === 'u2f' && auth.challenge ? (
21+
<U2fSign key={auth.id} {...props} challengeData={auth.challenge} />
22+
) : null
23+
)}
24+
</div>
25+
);
3226
}
3327

3428
export default U2fContainer;

0 commit comments

Comments
 (0)