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

bug: virtual-dom does not notice regex props changes #431

Open
0x24a537r9 opened this issue Apr 18, 2017 · 0 comments
Open

bug: virtual-dom does not notice regex props changes #431

0x24a537r9 opened this issue Apr 18, 2017 · 0 comments

Comments

@0x24a537r9
Copy link

If I have a regex prop, virtual-dom will never update it. See http://requirebin.com/?gist=013435cf5fc871d9f7b81eac75a94d1e or below:

var h = require('virtual-dom/h');
var diff = require('virtual-dom/diff');
var patch = require('virtual-dom/patch');
var createElement = require('virtual-dom/create-element');
var prettyFormat = require('pretty-format');

const before = h('div', {}, [
  h('div', {regex: /a/}, null),
]);
const after = h('div', {}, [
  h('div', {regex: /b/}, null),
]);

console.info(prettyFormat(diff(before, after)));

logs:

Object {
  "a": VirtualNode {
    "children": Array [
      VirtualNode {
        "children": Array [],
        "count": 0,
        "descendantHooks": false,
        "hasThunks": false,
        "hasWidgets": false,
        "hooks": undefined,
        "key": undefined,
        "namespace": null,
        "properties": Object {
          "regex": /a/,
        },
        "tagName": "DIV",
      },
    ],
    "count": 1,
    "descendantHooks": false,
    "hasThunks": false,
    "hasWidgets": false,
    "hooks": undefined,
    "key": undefined,
    "namespace": null,
    "properties": Object {},
    "tagName": "DIV",
  },
}

Note the lack of patches. I would expect a PROPS patch at index 0 for the regex prop.

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

No branches or pull requests

1 participant