Skip to content

Commit e5a6cbd

Browse files
author
Eric Olkowski
committed
Resolved React imports
1 parent 9316939 commit e5a6cbd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import * as React from 'react';
1+
import { createContext } from 'react';
22

33
interface AlertGroupContext {
44
hasAnimations?: boolean;
55
updateTransitionEnd?: (onTransitionEnd: () => void) => void;
66
}
77

8-
export const AlertGroupContext = React.createContext<AlertGroupContext>({
8+
export const AlertGroupContext = createContext<AlertGroupContext>({
99
hasAnimations: false,
1010
updateTransitionEnd: () => {}
1111
});

packages/react-integration/demo-app-ts/src/components/demos/AlertGroupDemo/AlertGroupAnimationsDemo.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import React from 'react';
1+
import { useState, Fragment } from 'react';
22
import { Alert, AlertProps, AlertGroup, AlertActionCloseButton, Button, Flex, FlexItem } from '@patternfly/react-core';
33

44
export const AlertGroupAnimationsDemo: React.FunctionComponent = () => {
5-
const [alerts, setAlerts] = React.useState<Partial<AlertProps>[]>([]);
5+
const [alerts, setAlerts] = useState<Partial<AlertProps>[]>([]);
66

77
const getUniqueId = () => new Date().getTime();
88
const addAlert = () => {
@@ -13,15 +13,15 @@ export const AlertGroupAnimationsDemo: React.FunctionComponent = () => {
1313
};
1414

1515
return (
16-
<React.Fragment>
16+
<Fragment>
1717
<Flex>
1818
<FlexItem>
1919
<Button id="add-alert-button" onClick={addAlert} variant="secondary">
2020
Add alert
2121
</Button>
2222
</FlexItem>
2323
</Flex>
24-
<AlertGroup hasAnimations isToast isLiveRegion>
24+
<AlertGroup isToast isLiveRegion>
2525
{alerts.map(({ key, title }) => (
2626
<Alert
2727
id="animated-alert"
@@ -38,6 +38,6 @@ export const AlertGroupAnimationsDemo: React.FunctionComponent = () => {
3838
/>
3939
))}
4040
</AlertGroup>
41-
</React.Fragment>
41+
</Fragment>
4242
);
4343
};

0 commit comments

Comments
 (0)