Commit 02ce5aff authored by amarcic's avatar amarcic
Browse files

added inline funtion for alert to HelloComputerButton

parent b82467d3
......@@ -3,6 +3,6 @@ import React from 'react';
export const HelloComputerButton = props => {
return(
<button>Hello Computer</button>
<button onClick={ (ev) => alert("Hi " + ev.type) }>Hello Computer</button>
);
}
\ No newline at end of file
//this index.js exports all components from the sub folders
//by doing this all components can be imported from './components/';
//named exports are used instead of default export; thus imports need to be destructured
//named exports are used instead of default export; thus imports need to be destructured
export { HelloComputerButton } from './HelloComputerButton/HelloComputerButton';
\ No newline at end of file
......@@ -8,7 +8,7 @@ class App extends React.Component{
return(
<div>
<span>Hello World</span><br />
<HelloComputerButton/>
<HelloComputerButton />
</div>
)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment