In React we generate html by javascript. We can use React.createElement() function from the React library to add an HTML element or we can use JSX syntax. Native JS
import React from 'react';
React.createElement('div', {},
React.createElement(
'button',
{
disabled: false,
onClick: () => { alert('clicked') }
},
'Click me'
)
)
Click me JSX
import React from 'react';
<div>
<button
disabled={false}
onClick={() => alert('clicked')}
>
Click me
</button>
</div>
Click me