Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor instructions editor to follow controlled component pattern #1397

Open
jwang1919 opened this issue Mar 24, 2018 · 1 comment
Open

Comments

@jwang1919
Copy link
Contributor

jwang1919 commented Mar 24, 2018

Currently the instructions editor is an uncontrolled component, which is to say that intermediate in-progress editing state is stored only in the DOM.

React officially recommends using controlled components instead, which stores intermediate state in React (in our case Redux) state, and has the form value mirror the props given. This is probably the right approach here (but maybe it’s not! Further research may be called for).

Probably best not to sweat this too much until #1394 is done (or at least concurrently with that task).

@outoftime outoftime changed the title Editable Instructions: Refactor Controlled Component Refactor instructions editor to follow controlled component pattern Mar 29, 2018
@outoftime outoftime added this to the Spring 2018 milestone Mar 29, 2018
@meg2208
Copy link
Collaborator

meg2208 commented Apr 6, 2018

FYI this turns out to be a prerequisite for #1394 since we are using SimpleMDE (via react plugin: since we are using https://github.com/RIP21/react-simplemde-editor) and it would get messy to extract the state from the DOM. Feel free to assign me to this as well. I will include it in that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants