react-native-button-toggle-group icon indicating copy to clipboard operation
react-native-button-toggle-group copied to clipboard

RNCMaskedView Error

Open WrathChaos opened this issue 4 years ago • 13 comments

CleanShot 2021-11-21 at 19 32 34

Hello, Lovely library however I could not even make it work with react-native 0.66+. This error just throwing. I'm using the same usage with your example:

import ButtonToggleGroup from 'react-native-button-toggle-group';


const [value, setValue] = React.useState('Light');

return (
<ButtonToggleGroup
    highlightBackgroundColor={'blue'}
    highlightTextColor={'white'}
    inactiveBackgroundColor={'transparent'}
    inactiveTextColor={'grey'}
    values={['Auto', 'Light', 'Dark']}
    value={value}
    onSelect={val => setValue(val)}
/>
)

WrathChaos avatar Nov 21 '21 16:11 WrathChaos

We've run into this issue before and I'm not convinced it's a problem on our end. (it tends to be two libraries fighting for dep version control and ending up installing two versions)

Here's how we fixed it in our app - Use yarn for your package manager and add a resolution for masked-view:

  "resolutions": {
    "@react-native-masked-view/masked-view": "0.2.6"
  },

crutchcorn avatar Nov 21 '21 18:11 crutchcorn

Unfortunately, we don't use yarn for the package manager. Do you have any other solution for that?

WrathChaos avatar Nov 22 '21 07:11 WrathChaos

Unfortunately not. NPM 7 mentioned adding support for something similar to resolutions, but memory serving it didn't quite make it in

Maybe if you can find a PR for anything with a lower version of this dep (something that doesn't fit in the carret range), it could help to make a PR back up and resolve the dup dep issue:

https://github.com/oceanbit/react-native-button-toggle-group/blob/master/package.json#L41

You can find this easier using npm ls @react-native-masked-view/masked-view

crutchcorn avatar Nov 22 '21 07:11 crutchcorn

we are running into this too

nikitph avatar Nov 29 '21 08:11 nikitph

@nikitph are you able to run the npm list command, as suggested and give the output for me?

Does the yarn workaround work as-intended?

crutchcorn avatar Nov 29 '21 08:11 crutchcorn

Couldn't make it work, same error. Is there any solution available? I get the following error, when I add "@react-native-masked-view/masked-view": "0.2.6" to the package: requireNativeComponent: "RNCMaskedView" was not found in the UIManager.

daniel-keen avatar May 16 '22 12:05 daniel-keen

Couldn't make it work, same error. Is there any solution available? I get the following error, when I add "@react-native-masked-view/masked-view": "0.2.6" to the package: requireNativeComponent: "RNCMaskedView" was not found in the UIManager.

He is not even do anything like 8 months. Don't wait anything from him. You can make a fork if you need it

WrathChaos avatar May 16 '22 16:05 WrathChaos

@WrathChaos I decided to create my own component instead :) It's actually not that hard.

daniel-keen avatar May 16 '22 16:05 daniel-keen

@thexdd Please share with me when you're done :)

WrathChaos avatar May 16 '22 17:05 WrathChaos

Please don't close this issue, since others are experiencing it as well.

@thexdd PRs welcome. The real solution would be to simply add in a peerDeps

crutchcorn avatar May 16 '22 18:05 crutchcorn

@crutchcorn https://stackoverflow.com/a/69266249/2203872 Here is a post that describes how you can do that.

daniel-keen avatar May 16 '22 19:05 daniel-keen

@thexdd to be clear, that answer is a valid (although much more simple) answer to how to create a button group.

This library adds in additional animations that are much more complex to add in. You're welcome to dive into the source code of what's been built to see the differences and additional complexity (in favor of a nicer UI/UX)

crutchcorn avatar May 16 '22 19:05 crutchcorn

To solve this all I did, was replace "@react-native-community/masked-view": "0.1.11", with "@react-native-masked-view/masked-view": "0.2.6".

olaitanade avatar Dec 15 '22 16:12 olaitanade