Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments: Render the Note Form #54

Closed
jayair opened this issue Apr 10, 2017 · 14 comments

Comments

@jayair
Copy link
Member

commented Apr 10, 2017

@jayair jayair added the Discussion label Apr 10, 2017

@mikhael28

This comment has been minimized.

Copy link

commented Jul 26, 2017

When I click a note to examine, the page redirects to prod/notes/undefined - and I get an error. Trying to figure out why the pushed link is undefined, instead of the dynamo db note id.

@jayair

This comment has been minimized.

Copy link
Member Author

commented Jul 26, 2017

@mikhaelbendavid You can check what is being returned by adding a console.log here - https://github.com/AnomalyInnovations/serverless-stack-demo-client/blob/render-the-note-form/src/containers/Home.js#L31.

@RaphaelMui

This comment has been minimized.

Copy link

commented Aug 9, 2017

When I click one of my note, a status code 500 returned.

@jayair

This comment has been minimized.

Copy link
Member Author

commented Aug 9, 2017

@RaphaelMui The 500 error should be something we are generating. Make sure the link for the note looks right. You can also check your CloudWatch logs for the error.

@RaphaelMui

This comment has been minimized.

Copy link

commented Aug 10, 2017

@jayair The Request URL is https://uy6essyal3.execute-api.us-east-1.amazonaws.com/prod/notes/9704e3b0-7d82-11e7-9f52-abe788a40b9a

From the CloudWatch logs,

2017-08-10T08:13:34.778Z	cd8bc624-7da3-11e7-a4d5-bf4a01ad26b2	ReferenceError: error is not defined
at _callee$ (/var/task/get.js:199:27)
at tryCatch (/var/task/node_modules/regenerator-runtime/runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/var/task/node_modules/regenerator-runtime/runtime.js:303:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/var/task/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/var/task/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /var/task/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
@jayair

This comment has been minimized.

Copy link
Member Author

commented Aug 10, 2017

@RaphaelMui Hmm that seems a bit cryptic. Can you try adding some debug message? For example, you can add a console.log before this line - https://github.com/AnomalyInnovations/serverless-stack-demo-api/blob/master/get.js#L27

@inventanew

This comment has been minimized.

Copy link

commented Dec 7, 2017

I'm getting this error...
./src/containers/Notes
Module build failed: Error: ENOENT: no such file or directory, open

@jayair

This comment has been minimized.

Copy link
Member Author

commented Dec 11, 2017

@inventanew Seems like that file might not be in the right location?

@mdhendri

This comment has been minimized.

Copy link

commented Mar 22, 2018

With the demo app I am getting the following error "This XML file does not appear to have any style information associated with it. The document tree is shown below." Why is this happening? I am also seeing this with my local app. It seems like the URL may be miss formed.

@jayair

This comment has been minimized.

Copy link
Member Author

commented Mar 22, 2018

@mdhendri Which page of the demo app are you seeing this on - https://demo.serverless-stack.com?

@mdhendri

This comment has been minimized.

Copy link

commented Mar 22, 2018

@iggirex

This comment has been minimized.

Copy link

commented Mar 30, 2018

How does wrapping JSX html code inside curly braces work? This line:

{this.state.note &&
        <form onSubmit={this.handleSubmit}>

Doesn't the && symbol make this a conditional statement? Wouldn't it just return a boolean? The instructions say "We render our form only when this.state.note is available." Is this the line that does that? How does && work here?

@jayair

This comment has been minimized.

Copy link
Member Author

commented Mar 30, 2018

@iggirex Yeah JSX is a bit confusing. One way to think about it is that React converts JSX into a set of standard JS calls to create components. In this case, if this.state.note is not null (or false), it'll return the React component called form. If it's null then it won't render anything.

Here is some info on how false is rendered in JSX - https://reactjs.org/docs/conditional-rendering.html#inline-if-with-logical--operator.

@jayair jayair closed this May 9, 2018

@jayair jayair reopened this May 9, 2018

@jayair

This comment has been minimized.

Copy link
Member Author

commented May 9, 2018

@jayair jayair closed this May 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.