* chore(deps): update dependency eslint to v9 * chore: migrate eslint to v9 * fix: dependency issues * fix: unit tests not working * chore: disable lint check for Image component that does not work in ci * fix: lint issue --------- Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com> Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
16 lines
430 B
TypeScript
16 lines
430 B
TypeScript
import React from "react";
|
|
|
|
type PropsWithChildren = Required<React.PropsWithChildren>;
|
|
|
|
export const composeWrappers = (
|
|
wrappers: React.FunctionComponent<PropsWithChildren>[],
|
|
): React.FunctionComponent<PropsWithChildren> => {
|
|
return wrappers.reverse().reduce((Acc, Current): React.FunctionComponent<PropsWithChildren> => {
|
|
return (props) => (
|
|
<Current>
|
|
<Acc {...props} />
|
|
</Current>
|
|
);
|
|
});
|
|
};
|