Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBrian Lockerbie
Full Stack JavaScript Techdegree Graduate 17,512 PointsFailed to compile. I am following the video and still getting this: Failed to compile
Failed to compile ./src/components/SearchForm.js Line 22:16: 'App' is not defined no-undef
Search for the keywords to learn more about each error.
This is the area I keep getting and I dont see what I am missing please help.
import React from 'react';
import {
Form,
FormGroup,
FormControl,
Button
} from 'react-bootstrap';
const Searchorm = () => (
<Form inline>
<FormGroup controlId="formInlineEmail">
<FormControl type="search" placeholder="enter something..." />
</FormGroup>
{' '}
<Button type="submit">
search
</Button>
</Form>
);
export default App;
```JavaScript
2 Answers
Jamie Gobeille
Full Stack JavaScript Techdegree Graduate 19,573 PointsTo me, it looks like he didn't show that you have to wrap the form in a return statement like so:
const SearchForm = () => {
return (
<Form inline>
<FormGroup controlId="formInlineEmail">
<FormControl type="search" placeholder="enter something..." />
</FormGroup>{" "}
<Button type="submit">search</Button>
</Form>
);
};
This ended up resolving the issue for me.
Jannick Moth
8,714 PointsLooks like your exporting app even though you've declared searchorm as the component name.
Try changing the export to export default searchorm (BTW you also have a typo searchform)
Hope it helps...
Brian Lockerbie
Full Stack JavaScript Techdegree Graduate 17,512 PointsBrian Lockerbie
Full Stack JavaScript Techdegree Graduate 17,512 Pointsmy SearchForum.js
import React from 'react'; import { Form, FormGroup, FormControl, Button } from 'react-bootstrap';
const Searchorm = () => ( <Form inline> <FormGroup controlId="formInlineEmail"> <FormControl type="search" placeholder="enter something..." /> </FormGroup> {' '} <Button type="submit"> search </Button> </Form>
);
export default App;