Matias Kinnunen
Matias Kinnunen
From the current documentation: > Because annotations cannot have children, an indented item following an annotation is considered that annotation's parent: > > ``` > Items: > - Item Y...
@gamburg, you could try out [my parser](https://github.com/mtsknn/margin-parser/) to see how this would work in practice (you can edit `playground.js` as instructed in the readme).
And `index` could instead be called `type` or `key`. The current documentation uses the term `type`, and there's a separate section called "Indexes": An index is any item that parents...
Related issue: - #183
👍 Probably a duplicate of #94.
The [`useAutoAnimate` hook](https://github.com/formkit/auto-animate/blob/1.0.0-beta.1/src/react/index.ts) has a ref in the dependency array of a `useEffect`: ```tsx const element = useRef(null) useEffect(() => { // ... }, [element]) ``` Refs are stable, so...
> an extra re-render is likely unavoidable with conditional rendering ...unless you split up the components like @stevecastaneda. IMO using `useState` in `useAutoAnimate` would provide better DX (no need to...
Good thoughts! I had a good night's sleep and realized that a [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) is all that's needed, and it also doesn't cause extra re-renders: [demo 3](https://flems.io/#0=N4IgZglgNgpgziAXAbVAOwIYFsZJAOgAsAXLKEAGhAGMB7NYmBvAHgBMIA3AAgjYF4AOiAwAHUcIB8LAPQdOkyiDgxY1YhHoJEIAAyIATLpABfCumy4d+AFYIqdBk2J4IWUbQBOxbhgCuxLQAgmhuGIzcYJ60WNwA5CTEonCIMjJ+aKIA1gDm+HRYMgACYF5YWRDEMv6BALQYoVjhMEUAjPi6HbUARjDEGPitMhBobDAAHvhYdnGCaHNgGeqaaNxB4gAUAJTcwHPc3I5wPshwhLQA7hTcgTk5sADK5xcAutz83ABKMBjq+H4qb5sPzUGCeDYbUSeGCcHb8STcACEUJh1zAGCgKi2+0OWhOwM84RW11u9xgABE-ISNPQ3h9vr9iP9ATBgaDwTiDpDobD3gjuTDuABqbgAdgArLodgBSbitSW6Cic7gGSU47HzVa4tDHbjISowLBwa4qYgASUYRrpXx+fwBMAe-UYG2QrWuBmuAGYXhqDkcfBg2GwLYb3txtnzuKaQ0aISjefDuPH8vRqOEBZx8LA0DliIRhXKthqcf69aIMNCGNb7UEAsFGs0NsBuASifRuCZfdrdcgoBBjtWVLXAiEws7m62aatO3MS1paLAUxliBs4pWxp4Rjk1uI4sWtdDiFTVhtlSxJMqDixRJJeqVoTcJsRZDfL9wWN0AoFVvQAMJ96gsn4YBSVgSlqRWExJFAmAWypNs0FkT9iG-C8tQOK9kO-bg-wAoCQNoO5HmeKCYKjZ4kK-eg0IwjD2C4bhoTAYDy0rYgoLfA5gDOS5uAAMj48NOLovwoEYmBmOAPtjg49DaPk4ADSNKYxAhJS4X5YT5PfPtuCyGAAE9gKU2TtLMjDFMtEwtPk2Q+xo8yMKLay5PMlh7Js2iPyon80H-CBAOAwNgysyRgsolDqM898ZA81zbPSKAHO0rYXO02R5GSuibwwMBGE8R9xmfGRXzk2QHI1Fy5gZdRyQAeQAWXwdcwQ2Fh1lEbgZEka4xFEfdFjQZZ2xrOtRyaZ1aFEKc4DDYBO12OcdR8NMoCgbpfiyb4wDDGqmXtX8MXWzbTzkjZVA07hVF4ZaGlBWgdoACQAFQagAZABRWAcAYfjBJqesxxgc6oGuKaZq2JU5OQcGVjgF51RxQ9jz1VbjsA7aEbQFylAKURoDBPANt6cgqBUNQZrwSVEGMEwXioPs0CybRUBATAcDwaFGSUKlyB0RJklSdJMlyFNCi59R0iwNgZAlpkxk4VQpp+pk7CUYgDNEKxlGoTdptMcw2csTnbWIWo2BiHnPD5kABZSNIMmyPICll03zZiKWZbl92sHwBWldEFXbHsEANa1vA4F1iB9bpkwgA). Hooray! Not sure...
Oh right, the hook returns a tuple, so could something like this work? ```js function useAutoAnimate(options = {}) { const stopAnimation = useRef(null) const callbackRef = useCallback( (element) => {...
By the way, I think `useCallback` is mostly unnecessary here because the `options` dependency changes so easily that `useCallback` will anyway recreate the callback ref function in most cases: ```js...