Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: initializing swiper for multiple blocks (#476)
Swiper wasn't initializing for additional blocks because `componentDidUpdate` (where we initialize Swiper) is not called for them. The reason that only the first block is calling `componentDidUpdate` is that the `latestPosts` prop is empty on mount and changes once the request is done, triggering the update. That is not the case for additional blocks because the `latestPosts` data is already there. Initializing `Swiper` on `componentDidMount` (if posts are available) fixes the issue.
- Loading branch information