Skip to content

What's a recommended strategy to toggle middleware? #2816

Answered by atomiks
kalnode asked this question in Q&A
Discussion options

You must be logged in to vote

https://floating-ui.com/docs/computePosition#conditional

It works like Rollup plugins where falsy values are filtered out.

middleware: [
  props.autoPlacement && autoPlacement(),
  offset({
    mainAxis: 10
  })
]

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@kalnode
Comment options

Answer selected by kalnode
Comment options

You must be logged in to vote
2 replies
@kalnode
Comment options

@atomiks
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants