Skip to content

Commit

Permalink
v0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed Sep 23, 2023
1 parent 93d260b commit 39c293d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion demo/tiddlers/docs/useRenderTiddler.tid
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Finally, in a child component, you can access the parent widget using the contex

```tsx
import React, { createRef } from 'react';
import { useRenderTiddler } from 'tw-react';
import { useRenderTiddler } from '$:/plugins/linonetwo/tw-react/index.js';

export function SideBarContent(props: { title: string }): JSX.Element {
const tabContentRef = createRef<HTMLDivElement>();
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"author": "LinOnetwo",
"core-version": ">=5.3.0",
"plugin-type": "plugin",
"version": "0.5.2",
"version": "0.5.3",
"list": "readme"
}
5 changes: 3 additions & 2 deletions src/readme.tid
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const Widget = require('$:/plugins/linonetwo/tw-react/widget.js').widget
Use the type:

```js
import { useRenderTiddler } from '$:/plugins/linonetwo/tw-react/index.js';
import type { ReactWidget } from 'tw-react';

const Widget = require('$:/plugins/linonetwo/tw-react/widget.js').widget as typeof ReactWidget;
Expand Down Expand Up @@ -88,10 +89,10 @@ getProps = () => {

!!! React Hooks

We provided some hooks for reactive data management with tw data source. You can import them from the `tw-react` package.
We provided some hooks for reactive data management with tw data source. You can import them from the `$:/plugins/linonetwo/tw-react/index.js` (Instead of from `tw-react` package, because they already included in the plugin).

```ts
import { useFilter } from 'tw-react'
import { useFilter } from '$:/plugins/linonetwo/tw-react/index.js'
```

You can't import them from plugin's file, because they are optional, so only included in the npm package, not in the plugin json bundle.
Expand Down

0 comments on commit 39c293d

Please sign in to comment.