Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

[WIP. Do not merge.] Attach render function to the stamp prototype #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

koresar
Copy link
Member

@koresar koresar commented Jun 24, 2016

Some modules check if FooComponent.prototype.render exists.
More info can be provided by @FredyC

This is just a sample change. @troutowicz please review.

@koresar koresar changed the title WIP. Do not merge. Attach render function to the stamp prototype [WIP. Do not merge.] Attach render function to the stamp prototype Jun 24, 2016
@danielkcz
Copy link
Contributor

@koresar Yea actually it seems I had been using that react-redux-provide in a bit wrong way, so it seems I wont need that change after all :) However it's not a bad change in my opinion, since render method is one of key points to identify React component, might be useful to have it there.

@troutowicz
Copy link
Member

troutowicz commented Jun 24, 2016

I guess I'd like to see an example of why this change would be useful. We can already test if the stamp is a valid React component using React's test utilities.

import assert from 'assert';
import React from 'react';
import reactStamp from 'react-stamp';
import { isCompositeComponent } from 'react-addons-test-utils';

const stamp = reactStamp(React).compose({
  render() {}
});

assert.ok(isCompositeComponent(stamp()));

@danielkcz
Copy link
Contributor

@troutowicz You are describing a case when you actually have component instance. However there are other modules (eg. react-redux-provide) that wants to check if given class is component by inspecting its prototype.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants