Sorry, but itโs bad approach, just to pass props to each component about selected modeโฆ at least you have to use styled theme context or css variables or whatever, but not like this
let Bio = {
username: 'hyggedev',
fullName: 'Chris Hansen',
bio: 'I createโก๏ธ fast modern, client-side websites with React and Javascript.',
passion: ['Blog', 'Tweet', 'Code']
};
This is definitely not the end goal. For beginners who are testing the waters, this is the easiest way imo to get something up and running asap. Context and Local storage would make this much better. But as for styled-components, this totally works!
You want to provide context about dark mode? And get this context state in components and then pass as props again to styled components? ;) just use styled-components theme, and to persist state you can use local storage for sure ๐
Beginners need to learn good patterns - this is the most important thing, imho ๐
let Bio = {
username: 'hyggedev',
fullName: 'Chris Hansen',
bio: 'I createโก๏ธ fast modern, client-side websites with React and Javascript.',
passion: ['Blog', 'Tweet', 'Code']
};
Sorry, but itโs bad approach, just to pass props to each component about selected modeโฆ at least you have to use styled theme context or css variables or whatever, but not like this
This is definitely not the end goal. For beginners who are testing the waters, this is the easiest way imo to get something up and running asap. Context and Local storage would make this much better. But as for styled-components, this totally works!
You want to provide context about dark mode? And get this context state in components and then pass as props again to styled components? ;) just use styled-components theme, and to persist state you can use local storage for sure ๐
Beginners need to learn good patterns - this is the most important thing, imho ๐
Update coming soon ๐