ffex
March 23, 2024, 9:53am
1
Hi everyone!
I want to develop a plugin for obsidian and I start to follow the tutorial and everithing is ok.
But I need to implement some custom control and I think to use React because I know a little bit… better than svelte anyway.
but I follow the tutorial: Use React in your plugin - Developer Documentation
and when I mounted view (Use React in your plugin - Developer Documentation ) not work.
So… I have some questions:
there is no log to check where the problem is?
why not put a github complete example repo? the error may be a setting thing.
So… maybe React it is not the best choice to develop a plugin with custom command?
if you want I can put a repo in this thread
React should work. Why don’t you share your code?
GitHub - zhouhua/obsidian-export-image this is my project, which using React. Perhaps you can take a look at it for reference.
ffex
March 26, 2024, 9:26am
3
This is the code: https://github.com/ffex/sample-plugin
The main branch there is two commit:
everything is work.
then I start to follow the react tutorial and when I do “Mount the React component” it didn’t compile and I don’t know where the problem is.
it is in the branch “react-tutorial”
Simply run npm run build
to get error messages, and then address them individually to resolve the issues:
1 Like
ffex
March 26, 2024, 5:23pm
6
I correct errors but nothing… the plugin not work, I push the fixes
ffex
April 11, 2024, 2:49pm
7
Problem was in the file tsconfig.json
at
{
"compilerOptions": {
"jsx": "preserve"
}
}
because this is in the documentation and last month was corrected:
{
"compilerOptions": {
"jsx": "react-jsx"
}
}
Now my plugin work Thanks everyone!