mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Use strings as the type for DOM elements
This makes ReactDOM a simple helper for creating ReactElements with the string tag as the type. The actual class is internal and created by instantiateReactComponent. Configurable using injection. There's not a separate class for each tag. There's just a generic ReactDOMComponent which could take any tag name. Invididual tags can be wrapped. When wrapping happens you can return the same tag again. If the wrapper returns the same string, then we fall back to the generic component. This avoids recursion in a single level wrapper.
This commit is contained in:
1 parent
35764c5ffb
commit
3aaccd2dc9
16 files changed
+328
-215
No files matched your search
@@ -106,7 +106,7 @@ mergeInto(reactComponentExpect.prototype, {
|
||||
|
||||
toBeComponentOfType: function(convenienceConstructor) {
|
||||
expect(
|
||||
this.instance().constructor === convenienceConstructor.type
|
||||
this.instance()._descriptor.type === convenienceConstructor.type
|
||||
).toBe(true);
|
||||
return this;
|
||||
},
|
||||
@@ -126,7 +126,7 @@ mergeInto(reactComponentExpect.prototype, {
|
||||
toBeCompositeComponentWithType: function(convenienceConstructor) {
|
||||
this.toBeCompositeComponent();
|
||||
expect(
|
||||
this.instance().constructor === convenienceConstructor.type
|
||||
this.instance()._descriptor.type === convenienceConstructor.type
|
||||
).toBe(true);
|
||||
return this;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user