From 783bbcfa058961fd8d595340e9bb97c820e944a2 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Thu, 5 Nov 2015 16:23:39 +0100 Subject: [PATCH] Use stateless functional component in dumb example "Dumb" components like this example seem to be an obvious place to use React 0.14 stateless functional components. This PR changes the example to use one. I don't know if a stateful component was a concious choice, but I would prefer stateless in this situation and I think it should be considered for the example. --- docs/quick-start.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/quick-start.md b/docs/quick-start.md index 35c205b49..2d651c057 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -42,16 +42,14 @@ It is advisable that only top-level components of your app (such as route handle Let’s say we have a `` “dumb” component with a number `value` prop, and an `onIncrement` function prop that it will call when user presses an “Increment” button: ```js -import { Component } from 'react'; - -export default class Counter extends Component { - render() { - return ( - - ) - } +import React from 'react' + +export default function Counter(props) { + return ( + + ) } ```