Skip to content

Instantly share code, notes, and snippets.

View Siemko's full-sized avatar
🐐
🐐 🐙 :octocat:

Dominik Guzy Siemko

🐐
🐐 🐙 :octocat:
View GitHub Profile
const Greeting = ({ name, ...props }) =>
<div {...props}>Hi {name}!</div>
const Greeting = ({name}) => <div>Hello {name}!</div>
const Greeting = props => <div>Hello {props.name}!</div>
<div class="better" data-gorrion="gorrion" data-other="other prop">Gorrion is always bettter</div>
<MyBetterDiv data-gorrion="gorrion" data-other="other prop">Gorrion is always bettter</MyBetterDiv>
const MyBetterDiv = props =>
<div className="better" {...props} />
class ButtonIncrement extends React.Component {
state = { counter: 0 }
handleOnClick = () => {
this.setState((prevState) => ({
counter: prevState.counter + 1
}));
}
render() {
@Siemko
Siemko / betterDiv.jsx
Created November 6, 2017 13:59
React components
const MyBetterDiv = props => (
<div className="better" {...props} />
)
@Siemko
Siemko / notes.md
Created September 17, 2017 14:17
React + redux basics

React+Redux action + reducer + usage

Actions

actions/index.js

export function actionFunction() {
  /*do somethings with data*/
  return {
    type: 'SAMPLE_ACTION' /*action type name, best from constants folder*/
    payload: data /*your data*/
  }
@Siemko
Siemko / notes.md
Last active June 6, 2017 07:25
Webdev współcześnie