import mdx file sebagai component
#react
#mdx
Import an MDX file in a component, similar to importing a regular component:
import Contents from '@/mdx/Contents.mdx';
// Usage
<Contents />
Turns out it’s in the documentation. Get used to reading it first, don’t be like me lol.
:not() pseudo-class
#css
#selector
Using :not() can be tricky, and incorrect usage can lead to unexpected results.
Example: styling inline code that is not a child of pre or .code-block. Usage:
Don't
:not(pre), :not(.code-block) {
> code {
background-color: 'red';
}
}
Do
:not(pre, .code-block) {
> code {
background-color: 'red';
}
}
Turborepo dependsOn
#turborepo
#monorepo
"build": {
"dependsOn": ["^lint", "test"]
},
dependsOn with ^ indicates tasks from other packages, while without ^ indicates tasks from the same package.
Example: when app A builds, it must run the lint tasks in all its dependency packages, and also run the test task in app A itself.