fix(client): inject bootstrap tags to the top of head (#40804)
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
9ec8aa3db4
commit
4879d26604
@ -32,3 +32,19 @@ export const onRenderBody = ({
|
||||
setHeadComponents(getheadTagComponents());
|
||||
setPostBodyComponents(getPostBodyComponents(pathname));
|
||||
};
|
||||
|
||||
export const onPreRenderHTML = ({
|
||||
getHeadComponents,
|
||||
replaceHeadComponents
|
||||
}) => {
|
||||
const headComponents = getHeadComponents();
|
||||
headComponents.sort((x, y) => {
|
||||
if (x.key === 'bootstrap-min-preload' || x.key === 'bootstrap-min') {
|
||||
return -1;
|
||||
} else if (y.key === 'bootstrap-min-preload' || y.key === 'bootstrap-min') {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
replaceHeadComponents(headComponents);
|
||||
};
|
||||
|
Reference in New Issue
Block a user