Skip to content

v4.0.0

Latest
Compare
Choose a tag to compare
@marcofugaro marcofugaro released this 20 Jun 14:09
  • Rename Spline Event listeners to onSplineXXX to avoid conflicts with native mouse/keyboard events #192
Before
export default function App() {
  function onMouseDown(e) {
    if (e.target.name === 'Cube') {
      console.log('I have been clicked!');
    }
  }

  return (
    <Spline
      scene="https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode"
      onMouseDown={onMouseDown}
    />
  );
}
After
export default function App() {
  function onSplineMouseDown(e) {
    if (e.target.name === 'Cube') {
      console.log('I have been clicked!');
    }
  }

  return (
    <Spline
      scene="https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode"
      onSplineMouseDown={onSplineMouseDown}
    />
  );
}
  • Allow usage of ErrorBoundary with Spline internal errors #193
Code example
import { ErrorBoundary } from "react-error-boundary";

<ErrorBoundary fallback={<div>Something went wrong</div>}>
  <Spline scene="https://prod.spline.design/6Wq1Q7YGyM-iab9i/scene.splinecode" />
</ErrorBoundary>