init datamate

This commit is contained in:
Dallas98
2025-10-21 23:00:48 +08:00
commit 1c97afed7d
692 changed files with 135442 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import React from "react";
export const MultiProvider = (props) => {
let content = props.children || null;
/* Error/Validation */
if (!props.providers) {
throw "MultiProvider: Missing providers prop";
}
if (!props.children) {
throw "MultiProvider: Missing children";
}
// Turn object into an array
// const numberOfProviders = props.providers.size;
const numberOfProviders = props.providers.length;
if (!numberOfProviders) {
// Providers prop is empty, r
return content;
}
[...(props.providers ?? [])].reverse().forEach((provider) => {
content = React.cloneElement(provider, null, content);
});
return content;
};