-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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
Added docs for React Tips section Introduction and Inline Styles Rea... #362
Added docs for React Tips section Introduction and Inline Styles Rea... #362
Conversation
### Solution | ||
Instead of writing a string, create an object whose key is the camelCased version of the style name, and whose value is the style's value, in string: | ||
|
||
```html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
js
:)
I think it might be better to put these under |
Yeah, that was my thought too. I just didn't want to break up the structure too much since I'm new here. But, if you think so I'll go ahead and make that change. :) |
@zpao was discussing scaling the cookbook section with @chenglou. I think the current layout works for the first 10-20 cookbook entries. He brought up it would be helpful as the section grows (50 entries+) to pull out the Jekyll yaml front matter block from the entries so we just have plain markdown files in the cookbook directory, and then have a grunt file that generates thefront matter block (title, permalink, js includes) for each page based on the filename. Doesn't look like Grunt is currently a dependency for the docs section. Wondering if that's something we want to add in the future? |
Hmm, I might have been sleep-talking, or maybe it wasn't me. Either way, let's tackle that problem if/when we get there and keep front matter in and not add any Grunt dependency. |
…oop through cookbook yaml. Added cookbook directory to js/ to add live editing of code samples
Was html before bc github screws up the js highlighting for jsx.
- No need to mention React, you know you're working with it =). - Wrap code elements in back ticks, so that they get the "box" styling for md. - You'd want the snippet to work inside the live editor, so you need to `renderComponent`. As per wiki specification, the DOM element on which to mount is `mountNode`, just like on the front page. - Don't forget the JSX pragma, or else your `render` fails. - Nitpick: empty line after the end of md. - No need for jQuery reference since 1. The general mood around React is that you don't need jQuery. 2. The syntax' still clear without jQuery. 3. We're doing a jQuery integration entry =). - `getInitialState` was absent. - You don't need `componentWillMount` here. fetch them in `getInitialState`. - The non-spoken convention seems to call the event handler `"handle" + eventName`. So `handleResize` clearly indicates it's a `resize` handler while `updateDimensions` might do something else. This latter name might actually be better under circumstances where you use call the method directly somewhere, but since we removed the only direct usage in `componentWillMount` this is fine. - Went OCD again and tried to keep the code short. `width` is enough of a demo. Removed `height`. - Distinguish between DOM events and React events. Wish we go full React events in a near future.
title case for entry titles; fix two entry names
Ok, I've been slowly digesting this over the past few days and here are my thoughts (some we talked about):
I'm going to do a pass through and tweak some grammar (curse my newspaper editor past) and send a PR over (hopefully tomorrow), but I think we're almost ready to merge this in and get it out into the world! |
Thanks for the great feedback Paul.
I'm excited to get this merged in! Again, appreciate of all your help and review. |
|
fix title case for tips everywhere
…cause it still referenced cookbooks. Updated some entry ID's (some side nav links didn't match entry permalinks)
@zpao updated section Intro to remove Cookbook references. Anything else you think we ought to add to the Introduction? |
I just opened mcsheffrey#20 for you with some edits. If you like them, then lets get this in :) |
Updates to tips
Thanks for all of the hard work and patience! |
...ct entry.