fluid-pointer-react
Version:
A dependency-free fluid simulation component with WebGL-based physics - supports both vanilla web components and React
17 lines (16 loc) • 869 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import FluidPointer from './FluidPointerReact';
import FluidPointerErrorBoundary from './components/FluidPointerErrorBoundary';
/**
* Enhanced FluidPointer component with built-in error boundary
*
* This component wraps the base FluidPointer with an error boundary to gracefully
* handle WebGL context issues and other errors that might occur during initialization
* or rendering of multiple instances.
*/
const FluidPointerWithErrorBoundary = forwardRef(({ errorFallback, onError, ...props }, ref) => {
return (_jsx(FluidPointerErrorBoundary, { fallback: errorFallback, onError: onError, children: _jsx(FluidPointer, { ref: ref, ...props }) }));
});
FluidPointerWithErrorBoundary.displayName = 'FluidPointerWithErrorBoundary';
export default FluidPointerWithErrorBoundary;