Theming is not working

Open
#3,847 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
react, react-native
Domain
mobile

Research direction

Start by reproducing the Button theme example on iOS with the listed @rneui/base, @rneui/themed, React, and React Native versions. No source file or test is named, so trace the ThemeProvider and Button theming entry points to determine why containerStyle and titleStyle have no effect; done means the Button shows a red background and yellow title.

Written by the indexing model from the issue text.

Description

Needs Triage
Is there an existing issue for this?
  • I have searched the existing issues
Explain what you did

I tried to them a Button. But its not working. Tested only in ios.

const theme = createTheme({
  components: {
    Button: {
      containerStyle: {
        margin: 10,
        backgroundColor: 'red',
      },
      titleStyle: {color: 'yellow'},
    },
  },
});
<ThemeProvider theme={theme}>
      <Button title="Themed Button" />
  </ThemeProvider>

@rneui/base: "^4.0.0-rc.7",
@rneui/themed: "^4.0.0-rc.8",
react": "18.2.0
react-native": "0.72.5

Expected behavior

Button should have red background and yellow title color

Describe the bug

There is no effect of theming, Button appear with default background color and text color

Steps To Reproduce
Create app, add theme and render component
Screenshots

No response

Your Environment
`npx @rneui/envinfo`
  ```
    Output from `npx @rneui/envinfo` goes here.
  ```
Dominant language
MDX
Stars
25.9k
Forks
4.7k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-native-elements/react-native-elements

All issues in react-native-elements/react-native-elements

Similar issues

More Mobile Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.