jaredpalmer / jaredpalmer/formik-effect

Context API

Open
#3 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
167
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Obviously React is getting a new Context API, but you have to support more than 16.3 with Formik so you won't be able to use it. I [asked Dan Abramov on Twitter](https://twitter.com/dan_abramov/status/979079793110069249) and he recommended using [React Broadcast](https://github.com/ReactTraining/react-broadcast) to polyfill it for older versions. What about adding this to `formik-effect`/`formik` instead of using the old context api? The primary reason is this:

```js
const MyPureComponent extends React.PureComponent {
render() {
return this.props.children;
}
}

const MyForm = (props) => (
console.log(values)}
initialValues={{ firstName: '', lastName: '', email: '' }}
render={props =>


{
// This will never receive changes as PureComponent props never change
// and wont pass them down to their children
}}
/>




Submit

}
/>
);
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the formik-effect/formik integration and the React Broadcast approach described in the issue, with attention to support for React versions before 16.3. Done means Effect receives Formik state changes when nested beneath a React.PureComponent while preserving the stated older-version support.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.