pub fn view<F>(mut self, val: F) -> Self
    where
        F: Fn(Scope, P) -> View<G> + Send + Sync + 'static,
    {
        self.template_inner.view =
            Box::new(|_, _, _, _| panic!("attempted to call template rendering logic for widget"));
        self.capsule_view = Box::new(
            #[allow(unused_variables)]
            move |app_cx, _preload_info, _template_state, props, path, caller_path| {
                let reactor = Reactor::<G>::from_cx(app_cx);
                // Declare that this page/widget will never take any state to enable full
                // caching
                reactor.register_no_state(&path, true);
                // And declare the relationship between the widget and its caller
                #[cfg(any(client, doc))]
                reactor.state_store.declare_dependency(&path, &caller_path);

                // Nicely, if this is a widget, this means there need be no network requests
                // at all!
                let mut view = View::empty();
                let disposer = create_child_scope(app_cx, |child_cx| {
                    view = val(child_cx, props);
                });
                Ok((view, disposer))
            },
        );
        self
    }
Sets the rendering function for capsules that take no state. Capsules
that do take state should use `.view_with_state()` instead.
packages/perseus/src/template/capsule.rs