Hidekih / editorjs-viewer-native

A React Native solution to parse outputData generated by EditorJs.
https://www.npmjs.com/package/editorjs-viewer-native
MIT License
43 stars 3 forks source link

Getting react native warning #5

Closed imransilvake closed 1 year ago

imransilvake commented 1 year ago

Thanks for the package, it works great. I have a small issue.

Usage:

const EditorJsViewerNative = createEditorJsViewer();
<EditorJsViewerNative data={{ blocks: JSON.parse(text) }} />

Data:

 LOG  [{"data": {"text": "test"}, "id": "97LefH_cM3", "type": "paragraph"}]

How can I fix that?

Screenshot 2023-05-29 at 17 09 44
yngfoxx commented 1 year ago

Hello @imransilvake I was having the same issue and I have opened a pull request #6 to address it, based on the source code the key prop is not assigned to the block component parent node which is a short form of the React.Fragment component e.g <></>

I am hoping @Hidekih see's it and approves it.

yngfoxx commented 1 year ago

An urgent fix to the package directly at node_modules\editorjs-viewer-native\dist\index.js would look like this:

find te=require('react') and replace with React=require('react') find all te. and replace with React. find all <> and replace with <React.fragment key={i.id}> find all </> and replace with </React.fragment>

And it should be good to go hehe else we will have to wait for @Hidekih to respond.

imransilvake commented 1 year ago

Hello @imransilvake I was having the same issue and I have opened a pull request #6 to address it, based on the source code the key prop is not assigned to the block component parent node which is a short form of the React.Fragment component e.g <></>

I am hoping @Hidekih see's it and approves it.

Thanks for the PR. I hope he merge the PR soon 🙂

Hidekih commented 1 year ago

Sorry for late response.

@imransilvake Thanks for the warning!

@yngfoxx Thanks for the PR!

editorjs-viewer-native v0.4.4 is available with fixes

💛