Useful for colour values, the 'AA' in #RRGGBBAA
hexa = Math.round(i*255).toString(16)
for (i=0; i<=1; i+=0.05) {
console.log(i, Math.round(i*255).toString(16))
}| module.exports = someViewFramework.extend({ | |
| element : ".js-thatElement", | |
| events : { | |
| "click" : "doStuff", | |
| "keypress" : "doStuffKeyboard" | |
| }, | |
| doStuff : function() { | |
| // foo |
So, about this short conversation about containing thing, some examples where I think this is not such an obvious move as it sounds.
import React from 'react';
export class Icon extends React.Component {
/* ... */
getDefaultProps() {
return {| .Icon{ | |
| display: inline-block; | |
| vertical-align: middle; | |
| color: inherit; | |
| } | |
| .Icon--defaultSize{ | |
| width: 1rem; | |
| } | |
| .Icon-subcontainer{ |
I hereby claim:
To claim this, I am signing this object:
| 17 ┆ jsStuff => | |
| 18 ┆ switch (beeTypeFromJs(jsStuff)) { | |
| >19 ┆ | Some(output) => output | |
| 20 ┆ | None => `baa | |
| 21 ┆ }; | |
| This has type: | |
| beeType | |
| But somewhere wanted: | |
| stuff4 |
@rescript/react 0.13.1 deprecates the usage of ReactDOM.Style.make. Depending on your codebase, the refacto may be important. Here's a method to help you migrate:
1 - Install Comby
2 - Download the config.toml config file to, say, the root of your repo
3 - Run comby -config conf.toml -f .res -matcher .re -i -d src (if your rescript codebase is in the src directory)
4 - Correct manually the type error(s). It's likely there are instances where the compiler doesn't have enough context to detect for example that the record {color: black} is of type JsxDOMStyle.t