eschutho commented on a change in pull request #18131:
URL: https://github.com/apache/superset/pull/18131#discussion_r793189883
##########
File path: superset-frontend/src/components/ReportModal/index.tsx
##########
@@ -191,13 +160,11 @@ const ReportModal: FunctionComponent<ReportProps> = ({
const [cronError, setCronError] = useState<CronError>();
const dispatch = useDispatch();
// Report fetch logic
- const reports = useSelector<any, AlertObject>(state => state.reports);
- const isEditMode = reports && Object.keys(reports).length;
+ const report = findReport;
Review comment:
instead of passing in the report, I would suggest fetching from Redux as
much as possible. You can import the function that you pass to useSelector if
you want to reuse the code.
```
const report = useSelector<any, AlertObject>(reportSelector)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]