Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 1.99 KB

01.md

File metadata and controls

58 lines (39 loc) · 1.99 KB

📌 01

These last days have been of adaptation. From Bahia directly to the Red Ventures office. It's a huge change, mainly about temperature.

Talking about job: Last year our RV FED team did a lot of nice stuff and I'm sure this year will be awesome!

:octocat: JS - React

Adding dynamic fields using react-redux-form.

// Assuming you have a 'user' modelReducer in your store,
// with an initial state of .phones = []

import { Field, actions } from 'react-redux-form';

// inside the render() method of your React component:

render() {
  const { user, dispatch }  = this.props;

  return (
    <div>
      { user.phones.map((phone, i) =>
        <Field model={`user.phones[${i}]`} key={i}>
          <input type="text" />
        </Field>
      }
      <button onClick={() => dispatch(actions.push('user.phones', ''))}>
        Add phone
      </button>
    </div>
  );
}

Reference

💬 Quotes

No one can be an expert in the whole web. Surgeons aren’t experts in all types of surgery, scientists aren’t experts in all of science, web developers aren’t experts in all of web development. - Jake Archibald

🔗 Links

💀 Currently


🏠 back home