# Tried Using Props with Stateless Functional Components in visual code but it's failing to compile

**URL:** <https://forum.freecodecamp.org/t/tried-using-props-with-stateless-functional-components-in-visual-code-but-its-failing-to-compile/243346>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [December 2, 2018, 6:52am UTC](https://forum.freecodecamp.org/t/tried-using-props-with-stateless-functional-components-in-visual-code-but-its-failing-to-compile/243346 "2018-12-02T06:52:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cruzgerman216](https://avatars.discourse-cdn.com/v4/letter/c/ad7895/32.png) [@cruzgerman216](https://forum.freecodecamp.org/u/cruzgerman216)\
**Post date:** [December 2, 2018, 6:52am UTC](https://forum.freecodecamp.org/t/tried-using-props-with-stateless-functional-components-in-visual-code-but-its-failing-to-compile/243346/1 "2018-12-02T06:52:01Z")

</div>

I really wished freecodecamp help you in installing react and node and everything but i guess it makes since because versions are always updating.

In this challenge i try to replicate it in visual code but in the code

Camper.propTypes = {  
name: Proptypes.string.isRequired  
};

PropTypes is not defined and I get a failed to compile. I check on the web and tried to install or import PropTypes but I’m having no luck. How am I suppose to use this on my own?

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [December 2, 2018, 11:55am UTC](https://forum.freecodecamp.org/t/tried-using-props-with-stateless-functional-components-in-visual-code-but-its-failing-to-compile/243346/2 "2018-12-02T11:55:44Z")

</div>

Just to make sure, It is PropTypes, not Proptypes (capital letter T on type).

```auto
Camper.propTypes = {
name: PropTypes.string.isRequired
};

```

Otherwise:

What is your build tooling, [create-react-app](https://reactjs.org/docs/create-a-new-react-app.html)? If not i would suggest using it, it’s a pretty good way to get started.

You should be able to just npm install prop-types and then import PropTypes from ‘prop-types’

1. Is prop-types in your package.json under the dependencies?
2. Are you importing prop-types into the file you are using it in?

---

<div class="post-metadata">

**Author:** ![Lucasl](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lucasl/32/335178_2.png) [@Lucasl](https://forum.freecodecamp.org/u/Lucasl)\
**Post date:** [December 2, 2018, 1:46pm UTC](https://forum.freecodecamp.org/t/tried-using-props-with-stateless-functional-components-in-visual-code-but-its-failing-to-compile/243346/3 "2018-12-02T13:46:41Z")

</div>

Yeah you’ll need to import it like lasjorg said. It used to be included in the main react package but was seperated into a separate package because lots of people use other typechecking solutions like flow or typescript.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [February 2, 2021, 11:24am UTC](https://forum.freecodecamp.org/t/tried-using-props-with-stateless-functional-components-in-visual-code-but-its-failing-to-compile/243346/4 "2021-02-02T11:24:11Z")

</div>

Closed on February 2, 2021, 11:24am UTC


