Skip to content

handle resize on useTransition #1917

Answered by joshuaellis
LoiKos asked this question in Support
Discussion options

You must be logged in to vote

Without seeing what you're trying to achieve (e.g. through a codesandbox) it's a bit hard to advise you well, are you able to share one?

My initial thoughts are you're not getting the data you're expecting by trying to do something like access the ref in the render method or maybe theres an issue with Portal where actually you need to use an arbitrary div to ensure something is always mounted (this is required if you use a library like Radix):

ReactDOM.createPortal(
  <div>
    {transitions(
      (styles, item) =>
        item && (
          <animated.div
            style={{
              ...styles,
              position: 'absolute',
            }}
          ></animated.div>
        )

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@LoiKos
Comment options

@joshuaellis
Comment options

@LoiKos
Comment options

@joshuaellis
Comment options

@LoiKos
Comment options

Answer selected by LoiKos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants