the following code will print a string instead of an object:
const rs = require('react-spring');
console.log(rs) //it prints: '/static/media/react-spring.development.286d67301b2cd6cdd0f1.cjs'
console.log(typeof rs) // it prints: 'string'
To Reproduce
create a react project by create-react-app tool
yarn create react-app mytest
add react-spring using yarn
yarn add react-spring
edit src/index.js and add the following code:
const rs = require('react-spring');
console.log(rs) //it prints: '/static/media/react-spring.development.286d67301b2cd6cdd0f1.cjs'
console.log(typeof rs) // it prints: 'string'
if it works in codesandbox then it's likely something to do with your code setup, I'd encourage you to supply a reproduction of your issue so it can be reviewed.
Which react-spring target are you using?
@react-spring/web
@react-spring/three
@react-spring/native
@react-spring/konva
@react-spring/zdog
What version of react-spring are you using?
9.7.3
What's Wrong?
the following code will print a string instead of an object: const rs = require('react-spring'); console.log(rs) //it prints: '/static/media/react-spring.development.286d67301b2cd6cdd0f1.cjs' console.log(typeof rs) // it prints: 'string'
To Reproduce
create a react project by create-react-app tool yarn create react-app mytest
add react-spring using yarn yarn add react-spring
edit src/index.js and add the following code: const rs = require('react-spring'); console.log(rs) //it prints: '/static/media/react-spring.development.286d67301b2cd6cdd0f1.cjs' console.log(typeof rs) // it prints: 'string'
the dependencies: node: v18.17.1 "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", "react-spring": "^9.7.3",
what weird is it works as expected in codesandbox , so I'm not sure if there any bugs involved, hope someone can take a look , thanks.
Expected Behaviour
const rs = require('react-spring');
the rs should be a object
Link to repo
what weird is it works as expected in codesandbox , so I'm not sure if there any bugs involved,