Expanded support for assignment and use of components #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Originally, Panic only supported the assignment of components to top-level variables. Now, you can assign components to the properties of objects. (panic:defcomponent (@ my-object property) ...) becomes myObject.property = React.createClass(...).
The current version of Panic allows for components to be included within other components by explicitly calling the constructor methods for the component classes, for example TodoList({ ... }), but React throws error messages when used this way. Instead of using the React.DOM functions to create instances of HTML DOM objects, React.createElement is now used to build all types of subcomponents.
When writing component forms, React components are now differentiated from DOM objects by the presence of a leading "-" in the symbol name. When translated to Javascript, this equates to a leading capital, as per React component naming convention. Hence, (:div ...) becomes React.createElement('div', ...), while (:-todo-list ...) becomes React.createElement(TodoList, ...).