elastic / eui

Elastic UI Framework 🙌
https://eui.elastic.co/
Other
6.09k stars 836 forks source link

Installation warnings when using React 18 (`react-input-autosize` `react-element-to-jsx-string`) #7080

Closed j-m closed 1 year ago

j-m commented 1 year ago

Hey folks! Thanks for adding support for React 17 and 18, it's much appreciated!

However, there are a couple of warnings when installing eui with react 18:

npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-element-to-jsx-string@14.3.4 npm WARN Found: react@18.2.0 npm WARN node_modules/react npm WARN peer react@"^16.12 || ^17.0 || ^18.0" from @elastic/eui@87.0.0 npm WARN node_modules/@elastic/eui npm WARN peer @elastic/eui@"^87.0.0" from the root project npm WARN 83 more (@emotion/react, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1" from react-element-to-jsx-string@14.3.4 npm WARN node_modules/@elastic/eui/node_modules/react-element-to-jsx-string npm WARN react-element-to-jsx-string@"^14.3.4" from @elastic/eui@87.0.0 npm WARN node_modules/@elastic/eui npm WARN npm WARN Conflicting peer dependency: react@17.0.2 npm WARN node_modules/react npm WARN peer react@"^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1" from react-element-to-jsx-string@14.3.4 npm WARN node_modules/@elastic/eui/node_modules/react-element-to-jsx-string npm WARN react-element-to-jsx-string@"^14.3.4" from @elastic/eui@87.0.0 npm WARN node_modules/@elastic/eui npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-element-to-jsx-string@14.3.4 npm WARN Found: react-dom@18.2.0 npm WARN node_modules/react-dom npm WARN peer react-dom@"^16.12 || ^17.0 || ^18.0" from @elastic/eui@87.0.0 npm WARN node_modules/@elastic/eui npm WARN peer @elastic/eui@"^87.0.0" from the root project npm WARN 49 more (@floating-ui/react-dom, @hello-pangea/dnd, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer react-dom@"^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1" from react-element-to-jsx-string@14.3.4 npm WARN node_modules/@elastic/eui/node_modules/react-element-to-jsx-string npm WARN react-element-to-jsx-string@"^14.3.4" from @elastic/eui@87.0.0 npm WARN node_modules/@elastic/eui npm WARN npm WARN Conflicting peer dependency: react-dom@17.0.2 npm WARN node_modules/react-dom npm WARN peer react-dom@"^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1" from react-element-to-jsx-string@14.3.4 npm WARN node_modules/@elastic/eui/node_modules/react-element-to-jsx-string npm WARN react-element-to-jsx-string@"^14.3.4" from @elastic/eui@87.0.0 npm WARN node_modules/@elastic/eui npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-input-autosize@3.0.0 npm WARN Found: react@18.2.0 npm WARN node_modules/react npm WARN peer react@"^16.12 || ^17.0 || ^18.0" from @elastic/eui@87.0.0 npm WARN node_modules/@elastic/eui npm WARN peer @elastic/eui@"^87.0.0" from the root project npm WARN 83 more (@emotion/react, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^16.3.0 || ^17.0.0" from react-input-autosize@3.0.0 npm WARN node_modules/@elastic/eui/node_modules/react-input-autosize npm WARN react-input-autosize@"^3.0.0" from @elastic/eui@87.0.0 npm WARN node_modules/@elastic/eui npm WARN npm WARN Conflicting peer dependency: react@17.0.2 npm WARN node_modules/react npm WARN peer react@"^16.3.0 || ^17.0.0" from react-input-autosize@3.0.0 npm WARN node_modules/@elastic/eui/node_modules/react-input-autosize npm WARN react-input-autosize@"^3.0.0" from @elastic/eui@87.0.0 npm WARN node_modules/@elastic/eui

Which is a really long way of saying react-input-autosize only supports peer react@"^16.3.0 || ^17.0.0" and react-element-to-jsx-string only supports peer react-dom@"^0.14.8 || ^15.0.1 || ^16.0.0 || ^17.0.1".

Which appears to be right, react-input-autosize doesn't support it at all (there's a fork tho): https://github.com/JedWatson/react-input-autosize/issues/196 and you need react-element-to-jsx-string to be on v15

cee-chen commented 1 year ago

Sorry it took us a while to get to this @j-m (and thanks as always for the incredibly helpful issue descriptions!) This should be fixed shortly by #7214 / in the next EUI release.