Skip to content

fix: deprecated nativeStyleToProp to nativestyleMapping#80

Open
Jin-Byun wants to merge 1 commit into
nativewind:mainfrom
Jin-Byun:update/v5/api/styled-page-mapping
Open

fix: deprecated nativeStyleToProp to nativestyleMapping#80
Jin-Byun wants to merge 1 commit into
nativewind:mainfrom
Jin-Byun:update/v5/api/styled-page-mapping

Conversation

@Jin-Byun
Copy link
Copy Markdown

@Jin-Byun Jin-Byun commented Jun 1, 2026

I was trying to get SymbolView from expo-symbols to work with styled.
The v5/api/styled show example of using nativeStyleToProp, when v5 uses nativeStyleMapping instead.

// from doc instruction
const StyledSymbolView = styled(SymbolView, {
    className: {
        target: "style",
        nativeStyleToProp: {
            tintColor: "style.color",
            weight: "style.fontWeight",
            size: "style.fontSize",
        },
    },
});

// what actually works
const StyledSymbolView = styled(SymbolView, {
    className: {
        target: "style",
        nativeStyleMapping: {
            color: "tintColor",
            fontWeight: "weight",
            fontSize: "size",
        },
    },
});

Currently, the only valid type for nativeStyleMapping (if declared) is Record<string,string>, like [styleSheetKey]: componentPropsKey,
This is a minimal change in documentation (just changing the code example), but I think it would be nice if this page could be structured like the api/withNativeWind page, with options describing target, nativeStyleMapping, etc in the future.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

@Jin-Byun is attempting to deploy a commit to the nativewind Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant