Discussion: should slice (and other missing ops) be shimmed? (e.g. slice in ReactNative)
See original GitHub issueI’m creating a ReactNative based app using this lib. When I run in iOS simulator, eveything goes fine. But when I run in my real Android device I’m having the following error:
[TypeError: undefined is not a function (evaluating 'data.slice(offset + junkLength, offset + 32)')]
It happens when I’m trying to execute the following piece of code after loading the wallet with my private key:
const updateBalance = () => (dispatch) => {
const { contract, wallet } = store.getState().wallet;
contract.functions.balanceOf(wallet.getAddress())
.then(({ balance }) => dispatch({ type: UPDATE_BALANCE, payload: balance }));
}
Looking at the lib source, I figured out the place where this error can be located at in this: https://github.com/ethers-io/ethers.js/blob/fb65772dd68d5ec5271ff2171560b306f013d09d/contracts/interface.js#L73
Do you have any idea of what might be happening?
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (11 by maintainers)
Top Results From Across the Web
Should every React component have it's own slice, when ...
No. There has never been a 1:1 association between components and Redux state structure. Instead, you should organize your state in terms of ......
Read more >How To Setup Redux Slices with Redux Toolkit - SoftKraft
createSlice takes an object of reducer functions, a slice name, and an initial state value and lets us auto-generate action types and action...
Read more >Lists and Keys - React
You can build collections of elements and include them in JSX using curly ... a key to our list items inside numbers.map() and...
Read more >A powerful React + Redux Toolkit pattern (reuseable state ...
Redux Toolkit includes a number of functions which make reusing similar "slices" of state quite easy, however there is a missing piece to ......
Read more >Airbnb JavaScript Style Guide()
It improves syntax highlighting, and is also more easily optimized by many JS engines. // bad const bad = { 'foo': ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Heya! it does for React too. I’ve added the automatic slice and a few other features that often missing in older environments, like React.
Can you try updating to the latest version and remove your shims to see if it works now, out of the box?
It passes all the PhantomJS tests sans shims, so I’m hoping it does for React too. 😃
Awesome!