Releases: elias-sundqvist/obsidian-react-components
0.0.6
0.0.5
0.0.5 (2021-05-22) Enable dynamic updates of Markdown Rendering component, minor changes
- Updating the
src
prop of theMarkdown
component previously did not cause the component to rerender. This is now fixed. - For developers: you can now create a
.vault_plugin_dir
file containing the path to the plugin in your vault: (e.g.path\to\my\vault\.obsidian\plugins\obsidian-react-components
). Thenyarn build
will automatically copy the compiled files to the correct place. So you only have to reload the plugin in Obsidian to see changes take effect.
0.0.4
0.0.4 (2021-05-20) Improved Component Loading and Error Handling + useIsPreview
-
Add a new setting to disable component refreshing
- Useful if re-rendering of components is costly, such as if the component makes API calls.
-
Make component loading more reliable (Resolves issue #13)
-
Significantly improve error handling
- All errors are rendered as react components. You can click a button in the component to show the error in the console.
-
Add a command to manually refresh components
Obsidian React Components: Refresh React Components
-
Replace
isPreviewMode
withuseIsPreview
, which check the current pane of the component instead of the currently active component (Resolves issue #12)Example:
const isPreview = useIsPreview() if(isPreview) { // this only happens if the pane which the component is attached to is in preview mode. }
0.0.3
0.0.3 (2021-05-10) Markdown rendering component, more hooks, and minor fixes
- Made some minor fixes based on feedback in the community-plugins PR
- Added a
Markdown
component, which can be used to render makdown.- Usage:
`jsx-<Markdown src={"* This is a bullet"}/>`
- Usage:
- Added
obsidian
to the component scope - Added more hooks:
useCallback
,useContext
,useMemo
,useReducer
,useRef
0.0.2
0.0.2 (2021-05-10) New functionality, bug fixes, and refactoring
-
@lucasew Added an
isPreviewMode
function to the component scope. (PR #5)There is a rule that in React you must call the same hooks at every render so early returns are not good.
The user can easily check if the note is on preview mode inside its component and can return null if it's the case.
-
Components which contain sub-components are now correctly updated when the sub-component code is modified. (PR #11)
-
Users are now warned when creating components with invalid names (PR #10)
0.0.1
0.0.1 (2021-05-04) First Release
- Basic functionality of the plugin implemented