question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'colors' of undefined

See original GitHub issue

TypeError: Cannot read property ‘colors’ of undefined

image

` import React, {Component} from ‘react’;

import { Button } from ‘styled-button-component’; import { Dropdown, DropdownItem, DropdownMenu, } from ‘styled-dropdown-component’;

const SimpleDropdown = (props) => ( <Button>Hello, World!</Button> );

export default SimpleDropdown; `

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
aichbauercommented, Mar 12, 2019

@aakhan89 thanks for reaching out…

I assume you are using a styled-components ThemeProvider with your own theme? If so you need to merge your own theme with the one that styled-bootstrap-components is exporting.

like

import { theme } from 'styled-config';
const myTheme = {
  ...yourTheme,
  ...theme,
};

const App = () => (
  <ThemeProvider theme={myTheme}>
    {/* your app here */}
  </ThemeProvider>
);
 

If not could you please provide a codesandbox with an example that is not working?

3reactions
aichbauercommented, Mar 12, 2019

@aakhan89

https://codesandbox.io/embed/zl133391mm?fontsize=14

here is how it works, I hope I could help you out.

Feel free to close this issue if you do not have any further questions…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styled Component in React: TypeError: Cannot read property ...
TypeError : Cannot read property 'white' of undefined. If I put in just a color, it works fine. But if I try to...
Read more >
Cannot set properties of undefined (setting 'color') in JS
The "Cannot set property 'color' of undefined" error occurs when setting the color property on an undefined value. To solve the error, check...
Read more >
Uncaught TypeError: Cannot read property 'color' of undefined
I'm trying to pass the id of a div into a function, (see code below), and get the "Uncaught TypeError: Cannot read property...
Read more >
Uncaught TypeError: Cannot set property 'color' of ... - YouTube
HTML : Javascript | Uncaught TypeError : Cannot set property ' color' of undefined [ Beautify Your Computer ...
Read more >
TypeError: cannot set property 'color' of undefined in pavlovia
TypeError : cannot set property 'color' of undefined in pavlovia · Begin routine. Checkboxes = [Implausible] Clicked = [] for box in Checkboxes: ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found