Closed dekiru2022 closed 2 years ago
参考1:https://bestofreactjs.com/repo/igorprado-react-notification-system-react-notification 参考2:https://note.crohaco.net/2018/react-libraries/ defaultRoute.js
import NotificationSystem from 'react-notification-system';
useEffect(() => {
const subscription = API.graphql(graphqlOperation(onCreateNotice)).subscribe({
next: (eventData) => {
const URL = eventData.value.data.onCreateNotice.linkDestinationUrl;
console.log(URL);
ref.current.addNotification({
title,
level,
position,
uid,
autoDismiss,
action: {
label: "相談者に会う",
callback: () => window.open(URL)
}
});
}
});
return () => subscription.unsubscribe();
})
ソースレビュします(我喜屋)