-2
PS. The idea here is not to use the parameter directly in Styled:
opacity: ${(props) => props.myArr[0].myOpacity)}
.
The idea would be:
- Pass a parameter (
myArray
) of any component for a Styled-Components:
<Wrap myArr={myArr}> ... <Wrap/>
- Receive this parameter within a Styled:
export const Wrap = styled.div<{myArr: Object[]}>`
//...
${ myFunc(props.myArr) } //<<< aqui minha dúvida
`;
- Send this parameter to a function within the same file.
Function myFunc(myArr: Object[]) {
//...
}