callstack / callstack/masked-view

maskElement not show

Open
#154 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.2k
Forks
131
PR merge metrics
No merged PRs in 30d

Description

Hi, please help my problem, the maskview and text not show in simulator:
```
import React from "react";
import {
View,
Image,
Dimensions,
TouchableHighlight,
TouchableOpacity,
Text
} from "react-native";
import FastImage from "react-native-fast-image";
import { ThemeContext } from "../../context/ThemeContext";
import gradientParser from 'gradient-parser'
import LinearGradient from "react-native-linear-gradient";
import MaskedView from '@react-native-masked-view/masked-view';

export const RecentlyUserHeader = (props) => {
const {theme} = React.useContext(ThemeContext)

const generateUserName = (props) => {
console.log('generateUserName', props.user.name)
try {
const gradient = gradientParser.parse(props.user.typeInfo.color)
console.log('regex', gradient)
const colors = gradient[0].colorStops.map((c) => {
const t = c.value
return `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${[3]})`
})
const locations = gradient[0].colorStops.map((c) => {
const l = c.length.value
return l/100
})
// console.log('color', colors)
return (
cacasc
}>



)
} catch(error) {
console.log('make gradient failed', error)
return (
{props.user.name}
)
}
}

return(
{
RootNavigation.push("Setting")
}}>



{generateUserName(props)}


)
}
```

Log result:

```
generateUserName demo4
LOG regex [{"colorStops": [[Object], [Object], [Object]], "orientation": {"type": "angular", "value": "180"}, "type": "linear-gradient"}]
```

![Screen Shot 2022-05-27 at 12 46 54](https://user-images.githubusercontent.com/8202437/170638023-d42c06bd-9e70-455f-a359-a026414c45b0.png)
Here is the image that maskview not show

And here is the image when only display Text:
![Screen Shot 2022-05-27 at 12 47 55](https://user-images.githubusercontent.com/8202437/170638109-131917b6-524b-4547-b563-028cec34a278.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.