preactjs / preact-router

:earth_americas: URL router for Preact.
http://npm.im/preact-router
MIT License
1.02k stars 155 forks source link

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

Closed mrispoli24 closed 2 years ago

mrispoli24 commented 3 years ago

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

cxreiff commented 2 years ago

I'm getting this as well.

miyacoz commented 2 years ago

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"
  }
}
developit commented 2 years ago

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');
}