Header Ads

ad728

Convert html to reactJS


Example 1

<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<header class="header" data-component="Header">
<h1 class="heading" data-component="Heading">Hello, world!</h1>
</header>
</body>

</html>
// header.js
import React from 'react';
import Heading from './heading';
const Header = React.createClass({
render() {
return (
<header className="header">
<Heading></Heading>
</header>
);
}
});
export default Header;
// heading.js
import React from 'react';
const Heading = React.createClass({
render() {
return <h1 className="heading">Hello, world!</h1>;
}
});
export default Heading;

Convert HTML to JSX

Enter your HTML here
{/* Hello world */}
Enter your HTML here
;

Convert SVG to React Native

import React from "react"; import Svg, { Path } from "react-native-svg"; const SvgComponent = props => ( ); export default SvgComponent;



No comments

Post Bottom Ad

ad728