I'm creating one npm package with react. But setState callback is not working in the npm package that I build. I used [email protected].
I tried with [email protected] and everything is working fine.
Any help for resolve the issue in 16.3.1 will be appreciated !!
@midhun1001 you should create a working example (for instance in https://codesandbox.io) that reproduces the problem.
I found out the cause of problem. Version compatibility issues. I used 15.6.x in my component and 16.3.1 in the custom build npm package.
When i made both 16.3.1, it worked well !!
You need to fix your component to not bundle React with it. React should be a peerDependency of your component, not a dependency.
Otherwise you'll keep getting similar issues with each new release.
thanks @gaearon
Will do that.
Most helpful comment
You need to fix your component to not bundle React with it. React should be a
peerDependencyof your component, not a dependency.Otherwise you'll keep getting similar issues with each new release.