We have a number of code blocks that are still JS-only. It would be useful to convert all of them to be toggleable TS/JS blocks instead. As an example, the initial example in createAsyncThunk:
Hi Mark, is this supposed to be done using the same remark tool?
In the long run we might switch to shiki-twoslash once they add a feature like that, but for now yes.
Generally: rename file to .mdx, fix up the TypeScript to successfully compile.
@phryneas great! just a quick query, the website dir contains package-lock.json but the README directs to use yarn instead, is that intended?
I assume that is the default docusaurus README, just ignore it for now. We will switch over to a yarn monorepo soon anyways.
Also, you might run into memory problems on the main branch. Update remark-typescript-tools to 1.0.7 to fix that.
@phryneas I'm trying to use the remark-typescript-tools on jsx snippets, but it doesn't seem to work. I have updated it to v1.0.7 before using, so I'm a bit confused here. Sorry if I'm missing something here 馃槄
Snippet
```ts title="index.tsx"
// file: App.tsx noEmit
import React from 'react'
export default function App() {
return
// file: app/store.ts noEmit
import { configureStore } from '@reduxjs/toolkit'
export default configureStore({
reducer: {},
})
// file: index.tsx
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
// highlight-start
import store from './app/store'
import { Provider } from 'react-redux'
// highlight-end
ReactDOM.render(
// highlight-next-line
,
document.getElementById('root')
)
```
Works fine with "jsx": "react"
Doesn't work with "jsx": "preserve"
Uhh, good question. I think we never had this use case before :sweat_smile: I might need to investigate that. But probably not before friday.
@PrinceRajRoy I just pushed remark-typescript-tools 1.0.8 which should be able to handle jsx: 'preserve'
@phryneas just updated, works perfectly fine now 馃槃
Most helpful comment
Uhh, good question. I think we never had this use case before :sweat_smile: I might need to investigate that. But probably not before friday.