Pushing overhaul.
This commit is contained in:
7
web/modules/custom/dc_react/js/src/components/Button.js
Normal file
7
web/modules/custom/dc_react/js/src/components/Button.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
function Button(props) {
|
||||
return <button className={"btn btn-" + props.classes}><a href={props.link}>{ props.text }</a></button>;
|
||||
}
|
||||
|
||||
export default Button;
|
||||
16
web/modules/custom/dc_react/js/src/components/Counter.js
Normal file
16
web/modules/custom/dc_react/js/src/components/Counter.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
function Counter() {
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p>You clicked {count} times</p>
|
||||
<button onClick={() => setCount(count + 1)}>
|
||||
Click me
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Counter;
|
||||
Reference in New Issue
Block a user