Vulkan best way of updating pipeline viewport

I have discovered that there are two ways to update the viewport (might be more, but not sure). Currently I am rebuilding the Pipeline when I resize my screen but there is a noticeable stutter as it rebuilds, but I have also found out that you can use vkCmdSetViewport when building/rebuilding your command buffers. But is this the right way to do it? And if I used vkCmdSetViewport, what should be put into the VkGraphicsPipelineCreateInfo pViewportState?

If there is an even better way of handling screen resizing please let me know.