Skip to main content

Update Block on Window Resize

  • September 23, 2020
  • 2 replies
  • 23 views

Hi there,

I’ve just made my first custom App (or Block as it used to be) with a d3 chart. So many possibilities!

I can’t work out how you set a component to re-render if the viewport is resized. Any suggestions would be appreciated.

Thanks,

Bryony

2 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • September 23, 2020

Congrats on your first custom app. That is a great accomplishment!

Try the useViewport hook. It updates when the viewport is resized.

By the way, I moved your post to the “Custom Apps” section of the forum so that other users who are interested in custom app development will be able to find your topic more easily.


  • Author
  • Participating Frequently
  • 5 replies
  • September 24, 2020

Congrats on your first custom app. That is a great accomplishment!

Try the useViewport hook. It updates when the viewport is resized.

By the way, I moved your post to the “Custom Apps” section of the forum so that other users who are interested in custom app development will be able to find your topic more easily.


Many thanks @kuovonne - exactly what I needed.