Closed roman-orlovskiy closed 7 years ago
Sorry for the delay, took a holiday and spent some extra time on break. Unfortunately there's still 2000 more issues for me to tackle, but I'm getting back slowly 😄
I fixed up the grammar slightly and will merge. Just a note though, you could have just updated the previous PR and pinged me - there's no need to open more than one PR per feature/issue. From the other thread (https://github.com/blakeembrey/free-style/pull/59):
propTypes
across components to support this in react-free-style
props.styles
, it depends again how you're getting these hints. If it's TypeScript types, you should be able to annotate it, but definitely a valid issue - unfortunately it's the only proper way to do it, react-free-style
is heavily designed for React projects so it binds to componentWillMount
- this way server side rendered applications receive the smallest possible CSS footprint for what's on pagereact-free-style
- I've built many applications with a styles/*.js
set up and copying styles across to components like you suggestFunction#bind
is incredibly slow and the way you were using it should be using Function#call
instead. You're still doing it too - please consider switching to Function#call
instead of bind
. E.g. do style = style.call(styles)
instead of style.bind(styles)()
.As an aside, there's a more performant way to change styles now too - you can use "change" events from free-style
to interact directly with a style sheet instance. Check out https://github.com/blakeembrey/react-free-style/blob/2aebdc92baa6193820b547d292b690ec5ab751f6/src/react-free-style.ts#L51-L60 to get an idea of how that would work.
Hello, i updated my module with some your remarks.