Jetpack infinite scroll not working on twentysixteen custom theme

I added the render and this is the full code.

function mytheme_infinite_scroll_init() {
add_theme_support( 'infinite-scroll', array(
'container' => 'content',
'render' => 'mytheme_infinite_scroll_render',
'container'      => 'content',
'posts_per_page' => 2,
) );
}

function mytheme_infinite_scroll_render() {
while( have_posts() ) {
    the_post();
    get_template_part( 'template-parts/content', get_post_format() );
    }
}

add_action( 'init', 'mytheme_infinite_scroll_init' );

you may find a problem that the pagination is shown and you may solve it by removing it from the theme or give it style display:none