v1.0.0
What's Changed
- feat!: FiberProvider for stable reference in useFiber by @CodyJasonBennett in #10
This release implements a <FiberProvider />
component that binds calls to useFiber
to the React Fiber tree. This ensures that components get a consistent reference to their respective Fiber regardless of their environment. As such, its-fine is now stable and the API has matured.
Note: pmndrs renderers like react-three-fiber implement this internally to make use of
useContextBridge
, so you would only need this when using hooks inside ofreact-dom
orreact-native
.
import * as ReactDOM from 'react-dom/client'
import { FiberProvider } from 'its-fine'
function App() {
const fiber = useFiber()
}
createRoot(document.getElementById('root')!).render(
<FiberProvider>
<App />
</FiberProvider>,
)
Full Changelog: v0.2.1...v1.0.0