V
V
Vs992019-04-22 12:38:41
JavaScript
Vs99, 2019-04-22 12:38:41

Custom implementation of react.createElement?

There is a code

var reactElementUl = React.createElement(
    'ul', {
        className: 'myList'
    },
        [
        'Some text',
        React.createElement('li', {}, 'one'),
        React.createElement('li', {className: 'li2'},'two'),
        React.createElement('li', {className: 'li3'},'three')
        ]
);

React.render(reactElementUl, document.getElementById('root'));

you need to create your own version of the methods
  • createElement
  • repeater

without using React.js,
the code should render a list with text inside on the page
, there are no problems with render, but with createElement it’s completely unclear how to do this
. I would be glad for any help, thanks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2019-04-22
@Vs99

Related links :
Build your own Front-end Framework / Library
Didact: a DIY guide to build your own React
https://github.com/pomber/didact
Build Your Own React — A Step By Step Guide

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question