Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment commit for prod-stable #1270

Merged
merged 13 commits into from
Oct 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Check refs' current prop
  • Loading branch information
dlabrecq committed Sep 28, 2024
commit 272d99f632c5ad99a2f49c6db49c4820c1f0e851
4 changes: 2 additions & 2 deletions src/routes/components/charts/breakdown/BreakdownChart.tsx
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ const BreakdownChart: React.FC<BreakdownChartProps> = ({
};

const handleOnResize = () => {
const { clientWidth = 0 } = containerRef.current || {};
const { clientWidth = 0 } = containerRef?.current || {};

if (clientWidth !== width) {
setWidth(clientWidth);
@@ -382,7 +382,7 @@ const BreakdownChart: React.FC<BreakdownChartProps> = ({
}, [top1stData, top2ndData, top3rdData, top4thData, top5thData]);

useEffect(() => {
const unobserve = getResizeObserver(containerRef.current, handleOnResize);
const unobserve = getResizeObserver(containerRef?.current, handleOnResize);
return () => {
if (unobserve) {
unobserve();
4 changes: 2 additions & 2 deletions src/routes/components/charts/trend/TrendChart.tsx
Original file line number Diff line number Diff line change
@@ -187,7 +187,7 @@ const TrendChart: React.FC<TrendChartProps> = ({
};

const handleOnResize = () => {
const { clientWidth = 0 } = containerRef.current || {};
const { clientWidth = 0 } = containerRef?.current || {};

if (clientWidth !== width) {
setWidth(clientWidth);
@@ -281,7 +281,7 @@ const TrendChart: React.FC<TrendChartProps> = ({
}, [currentData, thresholdData]);

useEffect(() => {
const unobserve = getResizeObserver(containerRef.current, handleOnResize);
const unobserve = getResizeObserver(containerRef?.current, handleOnResize);
return () => {
if (unobserve) {
unobserve();
8 changes: 4 additions & 4 deletions src/routes/components/filterTypeahead/FilterInput.tsx
Original file line number Diff line number Diff line change
@@ -196,10 +196,10 @@ const FilterInput: React.FC<FilterInputProps> = ({
// Close menu when a click occurs outside the menu or text input group
const handleOnPopperClick = event => {
if (
menuRef.current &&
textInputGroupRef.current &&
!menuRef.current.contains(event.target) &&
!textInputGroupRef.current.contains(event.target)
menuRef?.current &&
textInputGroupRef?.current &&
!menuRef?.current.contains(event.target) &&
!textInputGroupRef?.current.contains(event.target)
) {
setMenuIsOpen(false);
}
2 changes: 1 addition & 1 deletion src/routes/details/DetailsTableExpand.tsx
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ const DetailsTableExpand: React.FC<DetailsTableExpandProps> = ({
};

useEffect(() => {
if (isMounted.current) {
if (isMounted?.current) {
initDatum();
}
}, [JSON.stringify(report)]);
2 changes: 1 addition & 1 deletion src/utils/hooks.ts
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ export const useStateCallback = <T>(initialState: T): [T, (state: T, cb?: (_stat
useEffect(() => {
// cb.current is `undefined` on initial render,
// so we only invoke callback on state *updates*
if (cbRef.current) {
if (cbRef?.current) {
cbRef.current(state);
cbRef.current = undefined; // reset callback after execution
}
Loading