From 23db8aac59973c182f0ebd94a1dcb8c1e2610d98 Mon Sep 17 00:00:00 2001
From: Nate Wright <NateWr@users.noreply.github.com>
Date: Tue, 11 Dec 2018 18:14:51 +0000
Subject: [PATCH] Add attributes to ServerSideRender readme (#12793)

* Add attributes to ServerSideRender readme

Adds a code example demonstrating how to define attributes when registering a block that will use attributes in a ServerSideRender component.

* Add whitespace and inline code markup to ServerSideRender readme

Implements requested changes from code review.
---
 .../src/server-side-render/README.md          | 24 +++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/packages/components/src/server-side-render/README.md b/packages/components/src/server-side-render/README.md
index ee18a7f4294ed6..55b0be7630dabb 100644
--- a/packages/components/src/server-side-render/README.md
+++ b/packages/components/src/server-side-render/README.md
@@ -32,5 +32,25 @@ Output uses the block's `render_callback` function, set when defining the block.
 
 ## API Endpoint
 
-The API endpoint for getting the output for ServerSideRender is `/wp/v2/block-renderer/:block`. It accepts any params, which are used as `attributes` for the block's `render_callback` method.
-
+The API endpoint for getting the output for ServerSideRender is `/wp/v2/block-renderer/:block`. It will use the block's `render_callback` method.
+
+If you pass `attributes` to `ServerSideRender`, the block must also be registered and have its attributes defined in PHP.
+
+```php
+register_block_type(
+	'core/archives',
+	array(
+		'attributes'      => array(
+			'showPostCounts'    => array(
+				'type'      => 'boolean',
+				'default'   => false,
+			),
+			'displayAsDropdown' => array(
+				'type'      => 'boolean',
+				'default'   => false,
+			),
+		),
+		'render_callback' => 'render_block_core_archives',
+	)
+);
+```