Skip to content

Commit

Permalink
Only use new schedule loader if root element present (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
phildarnowsky authored Jul 18, 2019
1 parent b627736 commit 975592f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/site/assets/ts/schedule/schedule-loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,20 @@ const renderDirection = (schedulePageData: SchedulePageData): void => {
shape_map: shapesById,
route
} = schedulePageData;

const root = document.getElementById("react-schedule-direction-root");
if (!root) {
return;
}

ReactDOM.render(
<ScheduleDirection
directionId={directionId}
route={route}
routePatternsByDirection={routePatternsByDirection}
shapesById={shapesById}
/>,
document.getElementById("react-schedule-direction-root")
root
);
};

Expand Down

0 comments on commit 975592f

Please sign in to comment.