Comments (1)
or better a ref + useImperativeHandle since hooks would only work within the flex providers context tree
const ref = useRef()
const [{ width, height }, set] = useState({ width: 0, height: 0 })
useEffect(() => ref.current.onReflow = (width, height) => set({ width, height }), [])
return (
<>
<Canvas>
<Flex ref={ref}>
</Flex>
</Canvas>
<div style={{ height }} />
if the yoga instance has that functionality we just need flex to accept a ref.
from react-three-flex.
Related Issues (20)
- Codesandbox examples not working on iOS HOT 8
- Axis orientation HOT 2
- Boundingbox for Flex HOT 2
- Use scrollarea and mesh events HOT 6
- Width: auto on flex containers not taking the full space available HOT 4
- Box size control HOT 3
- Debug view HOT 3
- Rotation on flex root causes overlapping elements HOT 2
- Initial bounding box calculation are wrong when using nested boxes
- Vite compatibility HOT 3
- Sticky HOT 2
- Feature request: ignore invisible HOT 4
- Center of flex element is not aligned with parent object center. HOT 1
- Scaled box results in child elements collapsing on each other. HOT 1
- (Beginner) Faulty behaviour with changing Content and on Load
- Flex with text
- typescript errors with r3f v8 HOT 5
- Hook to get the position, similar to useFlexSize() HOT 1
- Update to a newer version of react-pdf/yoga
- Unexpected positioning of Box object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-three-flex.