fix: moved useEnforcingTrailingSlash upper in the hook chain

This commit is contained in:
Bilawal Hameed
2020-07-03 16:04:26 +02:00
parent 96c24c687b
commit 95ebc8eba9
@@ -65,6 +65,8 @@ const useEnforcedTrailingSlash = (): void => {
};
export const Reader = () => {
useEnforcedTrailingSlash();
const location = useLocation();
const { componentId, '*': path } = useParams();
const [ref, shadowRoot] = useShadowDom(componentId, path);
@@ -74,8 +76,6 @@ export const Reader = () => {
).formatBaseURL();
const state = useFetch(`${normalizedUrl}index.html`);
useEnforcedTrailingSlash();
React.useEffect(() => {
const divElement = shadowDomRef.current;
if (