Theming is not working as expected

オープン
#275 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
react-native, typescript
領域
mobile

調査の方向性

Start with the Theme.tsx borderRadii definition and the createRestyleComponent call that connects border to SkeletonPlaceholder.Item. Trace how the borderRadius value is resolved for the string token versus the numeric value, then reproduce the behavior on iOS and Android. Done means the themed round value is applied consistently with the numeric equivalent.

索引モデルが issue の本文から書いたものです。

説明

bug

Current behavior

I apply a borderRadius={'round'} which is defined in my Theme.tsx but it doesn't get applied to my SkeletonPlaceholder.Item whereas if I do borderRadius={1000} - rectangle becomes circle...

With borderRadius={'round'}
Simulator Screen Shot - iPhone 14 Pro - 2023-09-07 at 15 35 08

With borderRadius={1000}
Simulator Screen Shot - iPhone 14 Pro - 2023-09-07 at 15 36 23

Code:

import { Box, Theme } from '@/components/Theme';
import {
  border,
  createRestyleComponent,
} from '@shopify/restyle';
import SkeletonPlaceholder from 'react-native-skeleton-placeholder';


const SkeletonPlaceholderItem = createRestyleComponent<
  React.ComponentProps<typeof SkeletonPlaceholder.Item & typeof Box>,
  Theme
>([border], SkeletonPlaceholder.Item)

const RoundedSkeleton = ({ size = 100 }) => {
  return (
    <SkeletonPlaceholder>
      <SkeletonPlaceholderItem
        width={size}
        height={size}
        borderRadius={`round`} // result with borderRadius={1000} in screen 2
      />
    </SkeletonPlaceholder>
  )
}

export { RoundedSkeleton };

Expected behavior

borderRadius={'round'} should get applied with value from my Theme.tsx which is:

borderRadii: {
    none: 0,
    s: 4,
    ms: 6,
    m: 8,
    lm: 10,
    l: 12,
    xl: 20,
    round: 1000,
},

Platform:

  • iOS
  • Android

Environment

"@shopify/restyle": "^2.4.2",

主要言語
TypeScript
スター
3.4k
フォーク
154
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Shopify/restyle のほかの issue

Shopify/restyle の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。