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

Update example, tests and dependecies for react 16 support #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dimapaloskin
Copy link

Hello.

I updated dependencies, example and tests for supporting new react 16.

What do you think about it?

import PropTypes from 'prop-types'
import DOM from 'react-dom-factories'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can get rid of this. This was preferable solution in CoffeeScript, now it's obsolete. Can we use JSX everywhere instead?

@@ -28,8 +29,11 @@ describe('Shortcuts component', () => {
global.CustomEvent = window.CustomEvent
simulant = require('simulant')
ReactDOM = require('react-dom')
DOM = require('react-dom-factories')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, let's use JSX instead.

@@ -116,18 +120,18 @@ describe('Shortcuts component', () => {
})

it('should have children', () => {
const props = _.assign({}, baseProps, { children: React.DOM.div() })
const props = _.assign({}, baseProps, { children: DOM.div() })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove lodash and use Object.assign or { ...baseProps }.

baseContext.shortcuts.setKeymap(editedKeymap)

simulant.fire(node, 'keydown', { keyCode: space })
// sometimes node loose focus, so I added this timeout to fix it
setTimeout(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this timeout really necessary? Why did it work before without it?

Copy link
Author

@dimapaloskin dimapaloskin Oct 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good question. Currently I don't have time to deep debugging. I will back to this PR a bit later and will provide more info (or solution without monkey-patching which must be). If you do not do this faster than me sure :)

@greena13 greena13 mentioned this pull request Oct 23, 2017
@guillaume86
Copy link

I'm interested in getting rid of the yarn warnings about the peerDependency on react when using react v16. Is this PR still in the pipes?

@mistic
Copy link

mistic commented Nov 2, 2018

@petrbrzek @dimapaloskin can we move this forward in order to officially support react 16?

@krow-ten
Copy link

The problem with this PR is that it is trying to do too much.
The only thing that needs to change (to make end-users of this library happy) is to update package.json with

  "peerDependencies": {
    "react": ">=0.14.8",
    "react-dom": ">=0.14.8"
  }

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

Successfully merging this pull request may close these issues.

5 participants