preactjs/preact-router

Preact Router adding __source=[object Object] to all dom nodes

mrispoli24 opened this issue · 3 comments

I'm having a small issue where I notice that when I'm using the onChange handler for preact router and passing in some props saved as state to components I seem to get this __source=[object Object] appended to all nodes in the app.

Is this normal or some type of development property?

image

I'm getting this as well.

i don't think that's due to preact-router because i also see them in my preact project though i've not added preact-router yet.

here's my dependencies in package.json:

{
  "devDependencies": {
    "@types/styled-components": "^5.1.15",
    "eslint": "^8.3.0",
    "npm-run-all": "^4.1.5",
    "parcel": "^2.0.1",
    "prettier": "^2.5.0",
    "typescript": "^4.5.2"
  },
  "dependencies": {
    "preact": "^10.6.1",
    "recoil": "^0.5.2",
    "styled-components": "^5.3.3"
  }
}

Correct - this isn't related to preact-router. It happens when you have Babel configured to transpile JSX in development mode, but have not imported preact/debug. Something like this works in most bundlers:

if (process.env.NODE_ENV === 'development') {
  require('preact/debug');
}