DEV Community

Discussion on: Creating React components using only ES5 features

Collapse
 
carc1n0gen profile image
Carson • Edited

Ah I totally forgot Object.assign was not in es5. In that case, you'd keep your Object.create method of doing it, then for each other method you want on the prototype you would do

Component.prototype.something = function(...) {...}

Sorry for poor formatting. I'm on my phone.

Edit: updated fiddle jsfiddle.net/carc1n0gen/pg1a47qt/16/