Access a Component's state

In this exercise, https://www.codecademy.com/courses/react-101/lessons/this-state/exercises/access-component-state , it was stated that “Just like this.props, you can use this.state from any property defined inside of a component class’s body.” is it possible for the property to be defined outside the component class’s body and still work? for example

import React from 'react'; import ReactDOM from 'react-dom'; class Greeting extends React.Component { render() { return <h1>Hi there, {this.props.name}!</h1>; } } ReactDOM.render( <Greeting name='Groberta' />, document.getElementById('app') );

Thank you!