Skip to content

Update createRef to match the new React 16.3 api#4598

Merged
dzearing merged 5 commits into
microsoft:masterfrom
Markionium:mapol/fix-createRef-type
Apr 19, 2018
Merged

Update createRef to match the new React 16.3 api#4598
dzearing merged 5 commits into
microsoft:masterfrom
Markionium:mapol/fix-createRef-type

Conversation

@Markionium

Copy link
Copy Markdown
Member

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description of changes

Since the api for React.createRef changed from the initial PR/discussion on which we based the polyfill our version was out of sync with the recently announced version in React 16.3.

This PR takes care of that and updates the createRef function in utilities to match the React one.

Focus areas to test

(optional)

@micahgodbolt

Copy link
Copy Markdown
Member

So the API change from .value to .current? Any chance it's going to change again, or do we know this is the final version.

Also, this is a pretty big change for anyone that wrote code expecting the old api. Any chance we can deprecate the .value and support both until a future release?

If we are going to rip off the bandaid, we need to make sure to communicate that REALLY well. I just did a couple workshops where I demo'ed the .value approach.

@Markionium

Copy link
Copy Markdown
Member Author

It's fairly sure it's not going to change again as it's now released as part of the latest React version.

I think it's ok to add a deprecation and continue to support value for a while. The fact that you gave workshops on it definitely makes that point very valid. :)

@Markionium

Copy link
Copy Markdown
Member Author

@micahgodbolt I've added a .value prop that can be used as a getter for .current. :) (When we decide it's been enough time to migrate we can remove it)

@dzearing

Copy link
Copy Markdown
Member

Thank you for updating it!!

@dzearing dzearing merged commit e77a31b into microsoft:master Apr 19, 2018
Markionium added a commit to Markionium/office-ui-fabric-react that referenced this pull request Apr 19, 2018
* master:
  Applying package updates.
  ComboBox: Add any event as additional parameter to onChanged callback for saving pending changes (microsoft#4594)
  Remove usage of Number.NaN (microsoft#4615)
  Update createRef to match the new React 16.3 api (microsoft#4598)
  Update Breadcrumb.base.tsx
  Fix minor typos (microsoft#4607)
  Remove unused variables and enable no-unused-variable (microsoft#4608)
  Add optional overflowIndex prop to Breadcrumb (microsoft#4609)
  Applying package updates.
  Reenable bundlesize in yaml (microsoft#4590)
  Fix more index imports (microsoft#4604)
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants