Copies non-react specific statics from a child component to a parent component
95
Create a higher-order component that wraps a React component and mirrors non-React statics to the wrapper while respecting React blacklists and user-specified exclusions.
"div", the wrapper returns the original target unchanged. @testdisplayName and propTypes on the wrapped component are not copied onto the wrapper. @testomit map (e.g., { secret: true }), the wrapper skips those statics but still mirrors other custom statics. @testObject.prototype) are mirrored to the wrapper. @test@generates
/**
* Wraps a React component with a HOC that mirrors non-React statics to the wrapper.
* Reserved React statics stay untouched; user-provided omit map allows skipping keys.
*/
function withStatics(
WrappedComponent,
options = { omit: undefined }
) {}Copies non-React static properties while respecting React static blacklists.
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