Copies non-react specific statics from a child component to a parent component
95
Build a helper that wraps React components while preserving their custom static properties and keeps wrappers chainable for fluent higher-order composition.
@generates
/**
* Copies non-React-specific statics from a source component to a wrapper and returns the wrapper for further composition.
* @param {object} wrapperComponent - The component receiving statics.
* @param {object|string} sourceComponent - The component providing statics. If a string tag is provided, no statics are copied.
* @param {Record<string, boolean>} [exclusions] - Keys to skip when hoisting statics.
* @returns {object} The same wrapperComponent, ready for additional wrapping.
*/
export function chainableWrap(wrapperComponent, sourceComponent, exclusions);Copies static properties between React components while respecting React-reserved statics.
Install with Tessl CLI
npx tessl i tessl/npm-hoist-non-react-staticsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10