I tried to use react component like react-window in preact sandox which works perfectly fine locally but is not working in codesandbox.
Preact transpiler is currently using preact-compat instead of preact/compat (Required for Preact 10). I think we just need to fix this file https://github.com/codesandbox/codesandbox-client/blob/a616fcf3fd31eb75ee40451fbf9c2beb936b9559/packages/app/src/sandbox/eval/presets/preact-cli/index.js#L20
I will send PR soon after testing.
N/A. This issue is related to preact template
Exact same code is working fine with preact 8 (because it uses preact-compat). https://codesandbox.io/s/preact-8-template-compat-test-votvs
So we need to ensure that both Preact 8 and 10 sandboxes work after this fix.
We need to use preact/compat only if this module is available. Otherwise alias should fall back to preact-compat. I am not sure how to conditionally check whether a module is installed or not in sandbox like https://github.com/preactjs/preact-cli/blob/4319ff54b7a8ac073d700940d521cf25b84c3276/packages/cli/lib/lib/webpack/webpack-base-config.js#L99
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
This issue is still there so I think this shouldn't be closed.
@CompuIves can you please guide me how to fix this without breaking preact 8 sandboxes? :)
Hey!
So sorry this is still a thing, just made a PR to fix this
@all-contributors please add @armujahid for bug.
@armujahid
I've put up a pull request to add @armujahid! :tada: